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 int client_wait_for_cb_return(muse_camera_api_e api, callback_cb_info_s *cb_info, int time_out)
48 int ret = CAMERA_ERROR_NONE;
51 LOGD("Enter api : %d", api);
52 g_mutex_lock(&(cb_info->pMutex[api]));
54 if (cb_info->activating[api] == 0) {
55 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
56 if (g_cond_wait_until(&(cb_info->pCond[api]), &(cb_info->pMutex[api]), end_time)) {
57 LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
58 if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
59 LOGE("Get cb msg failed.");
60 ret = CAMERA_ERROR_INVALID_OPERATION;
62 LOGD("Wait passed, ret : 0x%x", ret);
64 if (cb_info->activating[api])
65 cb_info->activating[api] = 0;
67 LOGD("api %d was TIMED OUT!", api);
68 ret = CAMERA_ERROR_INVALID_OPERATION;
71 LOGE("condition is already checked for the api : %d.", api);
72 if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
73 LOGE("Get cb msg failed.");
74 ret = CAMERA_ERROR_INVALID_OPERATION;
76 LOGD("Already checked condition, Wait passed, ret : 0x%x", ret);
79 g_mutex_unlock(&(cb_info->pMutex[api]));
80 LOGD("ret : 0x%x", ret);
84 static void _client_user_callback(callback_cb_info_s * cb_info, muse_camera_event_e event )
86 char *recvMsg = cb_info->recvMsg;
87 int param, param1, param2;
88 LOGD("get event %d", event);
91 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
92 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
93 muse_camera_msg_get(param1, recvMsg);
94 muse_camera_msg_get(param2, recvMsg);
96 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
97 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
98 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
99 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
100 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
101 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
102 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
103 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
104 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
105 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
106 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
107 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
108 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
109 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
110 muse_camera_msg_get(param, recvMsg);
117 case MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE:
119 int cb_previous, cb_current, cb_by_policy;
120 muse_camera_msg_get(cb_previous, recvMsg);
121 muse_camera_msg_get(cb_current, recvMsg);
122 muse_camera_msg_get(cb_by_policy, recvMsg);
123 ((camera_state_changed_cb)cb_info->user_cb[event])((camera_state_e)cb_previous,
124 (camera_state_e)cb_current,
126 cb_info->user_data[event]);
129 case MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE:
132 muse_camera_msg_get(cb_state, recvMsg);
133 ((camera_focus_changed_cb)cb_info->user_cb[event])((camera_focus_state_e)cb_state,
134 cb_info->user_data[event]);
137 case MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE:
138 ((camera_capture_completed_cb)cb_info->user_cb[event])(cb_info->user_data[event]);
140 case MUSE_CAMERA_EVENT_TYPE_PREVIEW:
143 tbm_bo_handle bo_handle;
145 unsigned char *buf_pos = NULL;
146 camera_preview_data_s *frame = NULL;
147 muse_camera_msg_get(tbm_key, recvMsg);
150 LOGE("invalid key %d", tbm_key);
154 /* import tbm bo and get virtual address */
155 bo = tbm_bo_import(cb_info->bufmgr, tbm_key);
157 LOGE("bo import failed - bufmgr %p, key %d", cb_info->bufmgr, tbm_key);
161 bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
162 if (bo_handle.ptr == NULL) {
163 LOGE("bo map failed %p", bo);
168 buf_pos = (unsigned char *)bo_handle.ptr;
170 frame = (camera_preview_data_s *)buf_pos;
172 buf_pos += sizeof(camera_preview_data_s);
174 switch (frame->num_of_planes) {
176 frame->data.single_plane.yuv = buf_pos;
178 frame->data.double_plane.y = buf_pos;
179 buf_pos += frame->data.double_plane.y_size;
180 frame->data.double_plane.uv = buf_pos;
182 frame->data.triple_plane.y = buf_pos;
183 buf_pos += frame->data.triple_plane.y_size;
184 frame->data.triple_plane.u = buf_pos;
185 buf_pos += frame->data.triple_plane.u_size;
186 frame->data.triple_plane.v = buf_pos;
190 if (cb_info->user_cb[event]) {
191 ((camera_preview_cb)cb_info->user_cb[event])(frame,
192 cb_info->user_data[event]);
194 LOGW("preview cb is NULL");
198 muse_camera_msg_send1_no_return(MUSE_CAMERA_API_RETURN_BUFFER,
203 LOGD("return buffer Done");
205 /* unmap and unref tbm bo */
212 case MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW:
213 ((camera_media_packet_preview_cb)cb_info->user_cb[event])(NULL,
214 cb_info->user_data[event]);
216 case MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS:
219 muse_camera_msg_get(progress, recvMsg);
220 ((camera_attr_hdr_progress_cb)cb_info->user_cb[event])(progress,
221 cb_info->user_data[event]);
224 case MUSE_CAMERA_EVENT_TYPE_INTERRUPTED:
226 int cb_policy, cb_previous, cb_current;
227 muse_camera_msg_get(cb_policy, recvMsg);
228 muse_camera_msg_get(cb_previous, recvMsg);
229 muse_camera_msg_get(cb_current, recvMsg);
230 ((camera_interrupted_cb)cb_info->user_cb[event])((camera_policy_e)cb_policy,
231 (camera_state_e)cb_previous,
232 (camera_state_e)cb_current,
233 cb_info->user_data[event]);
236 case MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION:
239 muse_camera_msg_get(count, recvMsg);
240 ((camera_face_detected_cb)cb_info->user_cb[event])(NULL,
242 cb_info->user_data[event]);
245 case MUSE_CAMERA_EVENT_TYPE_ERROR:
247 int cb_error, cb_current_state;
248 muse_camera_msg_get(cb_error, recvMsg);
249 muse_camera_msg_get(cb_current_state, recvMsg);
250 ((camera_error_cb)cb_info->user_cb[event])((camera_error_e)cb_error,
251 (camera_state_e)cb_current_state,
252 cb_info->user_data[event]);
255 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
256 ((camera_supported_preview_resolution_cb)cb_info->user_cb[event])(param1, param2,
257 cb_info->user_data[event]);
259 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
260 ((camera_supported_capture_resolution_cb)cb_info->user_cb[event])(param1, param2,
261 cb_info->user_data[event]);
263 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
264 ((camera_supported_capture_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
265 cb_info->user_data[event]);
267 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
268 ((camera_supported_preview_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
269 cb_info->user_data[event]);
271 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
272 ((camera_attr_supported_af_mode_cb)cb_info->user_cb[event])((camera_attr_af_mode_e)param,
273 cb_info->user_data[event]);
275 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
276 ((camera_attr_supported_exposure_mode_cb)cb_info->user_cb[event])((camera_attr_exposure_mode_e)param,
277 cb_info->user_data[event]);
279 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
280 ((camera_attr_supported_iso_cb)cb_info->user_cb[event])((camera_attr_iso_e)param,
281 cb_info->user_data[event]);
283 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
284 ((camera_attr_supported_whitebalance_cb)cb_info->user_cb[event])((camera_attr_whitebalance_e)param,
285 cb_info->user_data[event]);
287 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
288 ((camera_attr_supported_effect_cb)cb_info->user_cb[event])((camera_attr_effect_mode_e)param,
289 cb_info->user_data[event]);
291 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
292 ((camera_attr_supported_scene_mode_cb)cb_info->user_cb[event])((camera_attr_scene_mode_e)param,
293 cb_info->user_data[event]);
295 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
296 ((camera_attr_supported_flash_mode_cb)cb_info->user_cb[event])((camera_attr_flash_mode_e)param,
297 cb_info->user_data[event]);
299 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
300 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
301 cb_info->user_data[event]);
303 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
304 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
305 cb_info->user_data[event]);
307 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
308 ((camera_attr_supported_stream_flip_cb)cb_info->user_cb[event])((camera_flip_e)param,
309 cb_info->user_data[event]);
311 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
312 ((camera_attr_supported_stream_rotation_cb)cb_info->user_cb[event])((camera_rotation_e)param,
313 cb_info->user_data[event]);
315 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
316 ((camera_attr_supported_theater_mode_cb)cb_info->user_cb[event])((camera_attr_theater_mode_e)param,
317 cb_info->user_data[event]);
319 case MUSE_CAMERA_EVENT_TYPE_CAPTURE:
321 int ret = CAMERA_ERROR_NONE;
322 camera_image_data_s *rImage = NULL;
323 camera_image_data_s *rPostview = NULL;
324 camera_image_data_s *rThumbnail = NULL;
325 unsigned char *buf_pos = NULL;
327 tbm_bo_handle bo_handle;
330 int is_thumbnail = 0;
332 muse_camera_msg_get(tbm_key, recvMsg);
333 muse_camera_msg_get(is_postview, recvMsg);
334 muse_camera_msg_get(is_thumbnail, recvMsg);
336 LOGD("camera capture callback came in. key %d, postview %d, thumbnail %d",
337 tbm_key, is_postview, is_thumbnail);
340 LOGE("invalid key %d", tbm_key);
344 /* import tbm bo and get virtual address */
345 bo = tbm_bo_import(cb_info->bufmgr, tbm_key);
347 LOGE("bo import failed - bufmgr %p, key %d", cb_info->bufmgr, tbm_key);
351 bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
352 if (bo_handle.ptr == NULL) {
353 LOGE("bo map failed %p", bo);
359 buf_pos = (unsigned char *)bo_handle.ptr;
360 rImage = (camera_image_data_s *)buf_pos;
361 rImage->data = buf_pos + sizeof(camera_image_data_s);
362 buf_pos += sizeof(camera_image_data_s) + rImage->size;
365 rPostview = (camera_image_data_s *)buf_pos;
366 LOGD("rPostview->size : %d", rPostview->size);
367 rPostview->data = buf_pos + sizeof(camera_image_data_s);
368 buf_pos += sizeof(camera_image_data_s) + rPostview->size;
372 rThumbnail = (camera_image_data_s *)buf_pos;
373 LOGD("rThumbnail->size : %d", rThumbnail->size);
374 rThumbnail->data = buf_pos + sizeof(camera_image_data_s);
375 buf_pos += sizeof(camera_image_data_s) + rThumbnail->size;
378 LOGD("read image info height: %d, width : %d, size : %d", rImage->height, rImage->width, rImage->size);
380 if (cb_info->user_cb[event]) {
381 ((camera_capturing_cb)cb_info->user_cb[event])(rImage, rPostview, rThumbnail, cb_info->user_data[event]);
383 LOGW("capture cb is NULL");
387 muse_camera_msg_send1(MUSE_CAMERA_API_RETURN_BUFFER, cb_info->fd, cb_info, ret, INT, tbm_key);
389 LOGD("return buffer result : 0x%x", ret);
391 /* unmap and unref tbm bo */
398 case MUSE_CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR:
402 LOGE("Unknonw event : %d", event);
407 static void *client_cb_handler(gpointer data)
415 callback_cb_info_s *cb_info = data;
416 char *recvMsg = cb_info->recvMsg;
417 char parseStr[CAMERA_PARSE_STRING_SIZE][MUSE_CAMERA_MSG_MAX_LENGTH] = {{0,0},};
419 while (g_atomic_int_get(&cb_info->running)) {
420 ret = muse_core_ipc_recv_msg(cb_info->fd, recvMsg);
428 memset(parseStr, 0, CAMERA_PARSE_STRING_SIZE * MUSE_CAMERA_MSG_MAX_LENGTH);
430 LOGD("recvMSg : %s, length : %d", recvMsg, ret);
432 /* Need to split the combined entering msgs.
433 This module supports up to 200 combined msgs. */
434 for (str_pos = 0; str_pos < ret; str_pos++) {
435 if(recvMsg[str_pos] == '}') {
436 strncpy(&(parseStr[num_token][0]), recvMsg + prev_pos, str_pos - prev_pos + 1);
437 LOGD("splitted msg : %s, Index : %d", &(parseStr[num_token][0]), num_token);
438 prev_pos = str_pos+1;
442 LOGD("num_token : %d", num_token);
444 /* Re-construct to the useful single msg. */
445 for (i = 0; i < num_token; i++) {
447 if (i >= CAMERA_PARSE_STRING_SIZE)
450 if (muse_camera_msg_get(api, &(parseStr[i][0]))) {
451 if(api < MUSE_CAMERA_API_MAX){
452 LOGD("Set Condition");
453 g_mutex_lock(&(cb_info->pMutex[api]));
455 /* The api msgs should be distinguished from the event msg. */
456 memset(cb_info->recvApiMsg, 0, strlen(cb_info->recvApiMsg));
457 strcpy(cb_info->recvApiMsg, &(parseStr[i][0]));
458 LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
459 cb_info->activating[api] = 1;
460 g_cond_signal(&(cb_info->pCond[api]));
461 g_mutex_unlock(&(cb_info->pMutex[api]));
463 if (api == MUSE_CAMERA_API_CREATE) {
464 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
465 if (ret != CAMERA_ERROR_NONE) {
466 g_atomic_int_set(&cb_info->running, 0);
467 LOGE("camera create error. close client cb handler");
470 LOGE("failed to get api return");
472 } else if (api == MUSE_CAMERA_API_DESTROY) {
473 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
474 if (ret == CAMERA_ERROR_NONE) {
475 g_atomic_int_set(&cb_info->running, 0);
476 LOGD("camera destroy done. close client cb handler");
479 LOGE("failed to get api return");
482 } else if(api == MUSE_CAMERA_CB_EVENT) {
484 if (muse_camera_msg_get(event, &(parseStr[i][0]))) {
485 LOGD("go callback : %d", event);
486 _client_user_callback(cb_info, event);
489 LOGW("unknown api : %d", api);
492 LOGE("Get Msg Failed");
497 LOGD("client cb exit");
502 static callback_cb_info_s *client_callback_new(gint sockfd)
504 callback_cb_info_s *cb_info;
506 GMutex *camera_mutex;
508 g_return_val_if_fail(sockfd > 0, NULL);
510 cb_info = g_new0(callback_cb_info_s, 1);
511 camera_cond = g_new0(GCond, MUSE_CAMERA_API_MAX);
512 camera_mutex = g_new0(GMutex, MUSE_CAMERA_API_MAX);
513 camera_activ = g_new0(gint, MUSE_CAMERA_API_MAX);
515 g_atomic_int_set(&cb_info->running, 1);
516 cb_info->fd = sockfd;
517 cb_info->pCond = camera_cond;
518 cb_info->pMutex = camera_mutex;
519 cb_info->activating = camera_activ;
521 g_thread_new("callback_thread", client_cb_handler,
527 static void client_callback_destroy(callback_cb_info_s * cb_info)
529 g_return_if_fail(cb_info != NULL);
531 LOGI("%p Callback destroyed", cb_info->thread);
533 g_thread_join(cb_info->thread);
534 g_thread_unref(cb_info->thread);
536 if (cb_info->bufmgr) {
537 tbm_bufmgr_deinit(cb_info->bufmgr);
538 cb_info->bufmgr = NULL;
541 if (cb_info->pCond) {
542 g_free(cb_info->pCond);
544 if (cb_info->pMutex) {
545 g_free(cb_info->pMutex);
547 if (cb_info->activating) {
548 g_free(cb_info->activating);
553 int camera_create(camera_device_e device, camera_h* camera)
557 int ret = CAMERA_ERROR_NONE;
558 camera_cli_s *pc = NULL;
559 tbm_bufmgr bufmgr = NULL;
561 muse_camera_api_e api = MUSE_CAMERA_API_CREATE;
562 muse_core_api_module_e muse_module = MUSE_CAMERA;
563 int device_type = (int)device;
566 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
567 return CAMERA_ERROR_INVALID_PARAMETER;
570 bufmgr = tbm_bufmgr_init(-1);
571 if (bufmgr == NULL) {
572 LOGE("get tbm bufmgr failed");
573 return CAMERA_ERROR_INVALID_OPERATION;
576 sock_fd = muse_core_client_new();
578 sndMsg = muse_core_msg_json_factory_new(api,
579 MUSE_TYPE_INT, "module", muse_module,
580 MUSE_TYPE_INT, PARAM_DEVICE_TYPE, (int)device_type,
583 muse_core_ipc_send_msg(sock_fd, sndMsg);
584 muse_core_msg_json_factory_free(sndMsg);
586 pc = g_new0(camera_cli_s, 1);
588 ret = CAMERA_ERROR_OUT_OF_MEMORY;
592 pc->cb_info = client_callback_new(sock_fd);
594 LOGD("cb info : %d", pc->cb_info->fd);
596 ret = client_wait_for_cb_return(api, pc->cb_info, CALLBACK_TIME_OUT);
597 if (ret == CAMERA_ERROR_NONE) {
599 muse_camera_msg_get_pointer(handle, pc->cb_info->recvMsg);
601 LOGE("Receiving Handle Failed!!");
602 ret = CAMERA_ERROR_INVALID_OPERATION;
605 pc->remote_handle = handle;
606 pc->cb_info->bufmgr = bufmgr;
608 LOGD("camera create 0x%x", pc->remote_handle);
609 *camera = (camera_h) pc;
617 tbm_bufmgr_deinit(bufmgr);
621 client_callback_destroy(pc->cb_info);
627 LOGE("camera create error : 0x%x", ret);
632 int camera_destroy(camera_h camera)
634 if (camera == NULL) {
635 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
636 return CAMERA_ERROR_INVALID_PARAMETER;
639 int ret = CAMERA_ERROR_NONE;
640 muse_camera_api_e api = MUSE_CAMERA_API_DESTROY;
641 camera_cli_s *pc = (camera_cli_s *)camera;
642 int sock_fd = pc->cb_info->fd;
646 LOGE("pc is already nul!!");
647 return CAMERA_ERROR_INVALID_PARAMETER;
648 } else if (pc->cb_info == NULL) {
649 return CAMERA_ERROR_INVALID_PARAMETER;
652 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
653 if (ret == CAMERA_ERROR_NONE) {
654 client_callback_destroy(pc->cb_info);
658 LOGE("camera destroy error : 0x%x", ret);
664 int camera_start_preview(camera_h camera)
667 if (camera == NULL) {
668 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
669 return CAMERA_ERROR_INVALID_PARAMETER;
672 int ret = CAMERA_ERROR_NONE;
673 muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
674 camera_cli_s *pc = (camera_cli_s *)camera;
676 char caps[MUSE_CAMERA_MSG_MAX_LENGTH] = {0};
678 if (pc->cb_info == NULL) {
679 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
680 return CAMERA_ERROR_INVALID_PARAMETER;
683 sock_fd = pc->cb_info->fd;
685 muse_camera_msg_send_longtime(api, sock_fd, pc->cb_info, ret);
686 LOGD("Enter, ret :0x%x", ret);
687 if(ret == CAMERA_ERROR_NONE) {
688 muse_camera_msg_get_string(caps, pc->cb_info->recvMsg);
689 LOGD("caps : %s", caps);
690 if (pc->cli_display_handle != 0) {
691 LOGD("client's display handle is : 0x%x", pc->cli_display_handle);
692 if(strlen(caps) > 0 &&
693 mm_camcorder_client_realize(pc->client_handle, caps) != MM_ERROR_NONE)
694 ret = CAMERA_ERROR_INVALID_OPERATION;
696 LOGD("display handle is NULL");
699 LOGD("ret : 0x%x", ret);
703 int camera_stop_preview(camera_h camera)
705 if (camera == NULL) {
706 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
707 return CAMERA_ERROR_INVALID_PARAMETER;
709 int ret = CAMERA_ERROR_NONE;
710 camera_cli_s *pc = (camera_cli_s *)camera;
712 muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
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 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
723 if(ret == CAMERA_ERROR_NONE) {
724 if (pc->cli_display_handle != 0) {
725 LOGD("Unrealize client");
726 if (pc->client_handle != NULL) {
727 ret = mm_camcorder_client_unrealize(pc->client_handle);
728 mm_camcorder_client_destroy(pc->client_handle);
731 LOGD("Client did not realized : Display handle is NULL");
734 LOGD("ret : 0x%x", ret);
738 int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data)
740 if (camera == NULL) {
741 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
742 return CAMERA_ERROR_INVALID_PARAMETER;
744 int ret = CAMERA_ERROR_NONE;
746 camera_cli_s *pc = (camera_cli_s *)camera;
747 muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
749 int is_capturing_cb = 0;
750 int is_completed_cb = 0;
751 LOGD("Enter, handle :%x", pc->remote_handle);
753 if (pc->cb_info == NULL) {
754 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
755 return CAMERA_ERROR_INVALID_PARAMETER;
758 sock_fd = pc->cb_info->fd;
760 if (capturing_cb != NULL) {
762 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
763 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
766 if(completed_cb != NULL) {
768 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
769 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
772 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, is_capturing_cb, INT, is_completed_cb);
773 LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
774 LOGD("ret : 0x%x", ret);
778 bool camera_is_supported_continuous_capture(camera_h camera)
780 if (camera == NULL) {
781 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
785 int ret = CAMERA_ERROR_NONE;
786 camera_cli_s *pc = (camera_cli_s *)camera;
787 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
790 if (pc->cb_info == NULL) {
791 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
792 return CAMERA_ERROR_INVALID_PARAMETER;
795 sock_fd = pc->cb_info->fd;
797 LOGD("Enter, remote_handle : %x", pc->remote_handle);
798 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
799 LOGD("ret : 0x%x", ret);
803 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)
805 if (camera == NULL) {
806 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
807 return 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_START_CONTINUOUS_CAPTURE;
815 LOGD("Enter, handle :%x", pc->remote_handle);
818 if (pc->cb_info == NULL) {
819 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
820 return CAMERA_ERROR_INVALID_PARAMETER;
822 sock_fd = pc->cb_info->fd;
824 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
825 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
826 pc->cb_info->user_cb_completed[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = completed_cb;
828 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, count, INT, interval);
829 LOGD("ret : 0x%x", ret);
833 int camera_stop_continuous_capture(camera_h camera)
835 if (camera == NULL) {
836 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
837 return CAMERA_ERROR_INVALID_PARAMETER;
841 int ret = CAMERA_ERROR_NONE;
843 camera_cli_s *pc = (camera_cli_s *)camera;
844 muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
845 LOGD("Enter, handle :%x", pc->remote_handle);
847 if (pc->cb_info == NULL) {
848 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
849 return CAMERA_ERROR_INVALID_PARAMETER;
851 sock_fd = pc->cb_info->fd;
852 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
853 LOGD("ret : 0x%x", ret);
857 bool camera_is_supported_face_detection(camera_h camera)
859 if (camera == NULL) {
860 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
863 int ret = CAMERA_ERROR_NONE;
865 camera_cli_s *pc = (camera_cli_s *)camera;
866 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
868 if (pc->cb_info == NULL) {
869 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
870 return CAMERA_ERROR_INVALID_PARAMETER;
872 sock_fd = pc->cb_info->fd;
874 LOGD("Enter, remote_handle : %x", pc->remote_handle);
875 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
876 LOGD("ret : 0x%x", ret);
880 bool camera_is_supported_zero_shutter_lag(camera_h camera)
882 if (camera == NULL) {
883 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
886 int ret = CAMERA_ERROR_NONE;
888 camera_cli_s *pc = (camera_cli_s *)camera;
889 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
891 if (pc->cb_info == NULL) {
892 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
893 return CAMERA_ERROR_INVALID_PARAMETER;
895 sock_fd = pc->cb_info->fd;
897 LOGD("Enter, remote_handle : %x", pc->remote_handle);
898 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
899 LOGD("ret : 0x%x", ret);
903 bool camera_is_supported_media_packet_preview_cb(camera_h camera)
905 if (camera == NULL) {
906 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
910 int ret = CAMERA_ERROR_NONE;
912 camera_cli_s *pc = (camera_cli_s *)camera;
913 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
915 if (pc->cb_info == NULL) {
916 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
917 return CAMERA_ERROR_INVALID_PARAMETER;
919 sock_fd = pc->cb_info->fd;
921 LOGD("Enter, remote_handle : %x", pc->remote_handle);
922 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
923 LOGD("ret : 0x%x", ret);
927 int camera_get_device_count(camera_h camera, int *device_count)
929 if (camera == NULL || device_count == NULL) {
930 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
931 return CAMERA_ERROR_INVALID_PARAMETER;
933 int ret = CAMERA_ERROR_NONE;
935 camera_cli_s *pc = (camera_cli_s *)camera;
936 muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
938 if (pc->cb_info == NULL) {
939 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
940 return CAMERA_ERROR_INVALID_PARAMETER;
942 sock_fd = pc->cb_info->fd;
943 int get_device_count;
945 LOGD("Enter, remote_handle : %x", pc->remote_handle);
946 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
948 if (ret == CAMERA_ERROR_NONE) {
949 muse_camera_msg_get(get_device_count, pc->cb_info->recvMsg);
950 *device_count = get_device_count;
952 LOGD("ret : 0x%x", ret);
956 int camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data)
958 if (camera == NULL) {
959 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
960 return CAMERA_ERROR_INVALID_PARAMETER;
963 int ret = CAMERA_ERROR_NONE;
965 camera_cli_s *pc = (camera_cli_s *)camera;
966 muse_camera_api_e api = MUSE_CAMERA_API_START_FACE_DETECTION;
968 LOGD("Enter, handle :%x", pc->remote_handle);
970 if (pc->cb_info == NULL) {
971 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
972 return CAMERA_ERROR_INVALID_PARAMETER;
974 sock_fd = pc->cb_info->fd;
975 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = callback;
976 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = user_data;
978 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
979 LOGD("ret : 0x%x", ret);
983 int camera_stop_face_detection(camera_h camera)
985 if (camera == NULL) {
986 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
987 return CAMERA_ERROR_INVALID_PARAMETER;
990 int ret = CAMERA_ERROR_NONE;
992 camera_cli_s *pc = (camera_cli_s *)camera;
993 muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
994 LOGD("Enter, handle :%x", pc->remote_handle);
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;
1001 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1002 LOGD("ret : 0x%x", ret);
1006 int camera_get_state(camera_h camera, camera_state_e * state)
1008 if (camera == NULL || state == NULL) {
1009 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1010 return CAMERA_ERROR_INVALID_PARAMETER;
1012 int ret = CAMERA_ERROR_NONE;
1014 camera_cli_s *pc = (camera_cli_s *)camera;
1015 muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
1017 if (pc->cb_info == NULL) {
1018 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1019 return CAMERA_ERROR_INVALID_PARAMETER;
1021 sock_fd = pc->cb_info->fd;
1024 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1025 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1027 if (ret == CAMERA_ERROR_NONE) {
1028 muse_camera_msg_get(get_state, pc->cb_info->recvMsg);
1029 *state = (camera_state_e)get_state;
1031 LOGD("ret : 0x%x", ret);
1035 int camera_start_focusing(camera_h camera, bool continuous)
1037 if( camera == NULL){
1038 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1039 return CAMERA_ERROR_INVALID_PARAMETER;
1042 int ret = CAMERA_ERROR_NONE;
1044 camera_cli_s *pc = (camera_cli_s *)camera;
1045 muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
1047 if (pc->cb_info == NULL) {
1048 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1049 return CAMERA_ERROR_INVALID_PARAMETER;
1051 sock_fd = pc->cb_info->fd;
1052 int is_continuous = (int)continuous;
1054 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1055 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, is_continuous);
1056 LOGD("ret : 0x%x", ret);
1060 int camera_cancel_focusing(camera_h camera)
1062 if (camera == NULL) {
1063 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1064 return CAMERA_ERROR_INVALID_PARAMETER;
1067 int ret = CAMERA_ERROR_NONE;
1069 camera_cli_s *pc = (camera_cli_s *)camera;
1070 muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
1072 if (pc->cb_info == NULL) {
1073 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1074 return CAMERA_ERROR_INVALID_PARAMETER;
1076 sock_fd = pc->cb_info->fd;
1078 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1079 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1080 LOGD("ret : 0x%x", ret);
1084 int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
1086 int ret = CAMERA_ERROR_NONE;
1087 int display_surface;
1088 void *set_display_handle = NULL;
1089 int set_surface = MM_DISPLAY_SURFACE_X;
1090 Evas_Object *obj = NULL;
1091 const char *object_type = NULL;
1092 char socket_path[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
1094 if (camera == NULL) {
1095 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1096 return CAMERA_ERROR_INVALID_PARAMETER;
1099 if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
1100 LOGE("display type[%d] is not NONE, but display handle is NULL", type);
1101 return CAMERA_ERROR_INVALID_PARAMETER;
1104 int display_type = (int)type;
1105 camera_cli_s *pc = (camera_cli_s *)camera;
1106 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
1108 if (pc->cb_info == NULL) {
1109 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1110 return CAMERA_ERROR_INVALID_PARAMETER;
1112 sock_fd = pc->cb_info->fd;
1114 LOGD("Enter, remote_handle : %x display : 0x%x", pc->remote_handle, display);
1116 if (type == CAMERA_DISPLAY_TYPE_NONE) {
1117 set_display_handle = 0;
1118 set_surface = MM_DISPLAY_SURFACE_NULL;
1119 LOGD("display type NONE");
1121 obj = (Evas_Object *)display;
1122 object_type = evas_object_type_get(obj);
1124 if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1126 MMCamWaylandInfo *wl_info = g_new0(MMCamWaylandInfo, 1);
1128 if (wl_info == NULL) {
1129 LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
1130 return CAMERA_ERROR_OUT_OF_MEMORY;
1133 wl_info->evas_obj = (void *)obj;
1134 wl_info->window = (void *)elm_win_wl_window_get(obj);
1135 wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
1136 wl_info->display = (void *)ecore_wl_display_get();
1138 if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
1139 LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
1140 return CAMERA_ERROR_INVALID_OPERATION;
1143 evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
1144 &wl_info->window_width, &wl_info->window_height);
1146 /* set wayland info */
1147 pc->wl_info = wl_info;
1148 set_surface = MM_DISPLAY_SURFACE_X;
1149 set_display_handle = (void *)wl_info;
1151 LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
1152 wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
1153 wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
1154 #else /* HAVE_WAYLAND */
1155 /* x window overlay surface */
1156 set_display_handle = (void *)elm_win_xwindow_get(obj);
1157 set_surface = MM_DISPLAY_SURFACE_X;
1158 LOGD("display type OVERLAY : handle %p", set_display_handle);
1160 } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
1161 /* evas object surface */
1162 set_display_handle = (void *)display;
1163 set_surface = MM_DISPLAY_SURFACE_EVAS;
1164 LOGD("display type EVAS : handle %p", set_display_handle);
1166 LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
1167 return CAMERA_ERROR_INVALID_PARAMETER;
1170 LOGE("failed to get evas object type from %p", obj);
1171 return CAMERA_ERROR_INVALID_PARAMETER;
1175 pc->cli_display_handle = (intptr_t)set_display_handle;
1176 display_surface = (int)set_surface;
1177 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret,
1179 INT, display_surface);
1181 if (ret == CAMERA_ERROR_NONE && type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1182 if (mm_camcorder_client_create(&(pc->client_handle))) {
1183 LOGE("camera client create Failed");
1184 return CAMERA_ERROR_INVALID_OPERATION;
1186 muse_camera_msg_get_string(socket_path, pc->cb_info->recvMsg);
1187 LOGD("shmsrc stream path : %s", socket_path);
1188 if(mm_camcorder_client_set_shm_socket_path(pc->client_handle, socket_path)
1190 return CAMERA_ERROR_INVALID_OPERATION;
1191 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1192 MMCAM_DISPLAY_SURFACE, set_surface,
1194 if (ret == MM_ERROR_NONE && type != CAMERA_DISPLAY_TYPE_NONE) {
1195 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1196 MMCAM_DISPLAY_HANDLE, pc->cli_display_handle, sizeof(void *),
1198 LOGD("ret : 0x%x", ret);
1201 LOGD("ret : 0x%x", ret);
1205 int camera_set_preview_resolution(camera_h camera, int width, int height)
1207 if( camera == NULL){
1208 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1209 return CAMERA_ERROR_INVALID_PARAMETER;
1211 int ret = CAMERA_ERROR_NONE;
1213 camera_cli_s *pc = (camera_cli_s *)camera;
1214 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
1216 if (pc->cb_info == NULL) {
1217 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1218 return CAMERA_ERROR_INVALID_PARAMETER;
1220 sock_fd = pc->cb_info->fd;
1222 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1223 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1224 LOGD("ret : 0x%x", ret);
1229 int camera_set_capture_resolution(camera_h camera, int width, int height)
1231 if (camera == NULL) {
1232 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1233 return CAMERA_ERROR_INVALID_PARAMETER;
1236 int ret = CAMERA_ERROR_NONE;
1238 camera_cli_s *pc = (camera_cli_s *)camera;
1239 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
1241 if (pc->cb_info == NULL) {
1242 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1243 return CAMERA_ERROR_INVALID_PARAMETER;
1245 sock_fd = pc->cb_info->fd;
1247 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1248 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1249 LOGD("ret : 0x%x", ret);
1253 int camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
1255 if (camera == NULL) {
1256 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1257 return CAMERA_ERROR_INVALID_PARAMETER;
1260 int ret = CAMERA_ERROR_NONE;
1261 int set_format = (int)format;
1263 camera_cli_s *pc = (camera_cli_s *)camera;
1264 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
1266 if (pc->cb_info == NULL) {
1267 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1268 return CAMERA_ERROR_INVALID_PARAMETER;
1270 sock_fd = pc->cb_info->fd;
1272 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1273 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1274 LOGD("ret : 0x%x", ret);
1278 int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
1280 if (camera == NULL) {
1281 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1282 return CAMERA_ERROR_INVALID_PARAMETER;
1285 int ret = CAMERA_ERROR_NONE;
1286 int set_format = (int)format;
1288 camera_cli_s *pc = (camera_cli_s *)camera;
1289 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
1291 if (pc->cb_info == NULL) {
1292 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1293 return CAMERA_ERROR_INVALID_PARAMETER;
1295 sock_fd = pc->cb_info->fd;
1297 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1298 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1299 LOGD("ret : 0x%x", ret);
1303 int camera_get_preview_resolution(camera_h camera, int *width, int *height)
1305 if (camera == NULL || width == NULL || height == NULL) {
1306 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1307 return CAMERA_ERROR_INVALID_PARAMETER;
1311 int ret = CAMERA_ERROR_NONE;
1313 camera_cli_s *pc = (camera_cli_s *)camera;
1314 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
1316 if (pc->cb_info == NULL) {
1317 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1318 return CAMERA_ERROR_INVALID_PARAMETER;
1320 sock_fd = pc->cb_info->fd;
1324 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1325 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1327 if (ret == CAMERA_ERROR_NONE) {
1328 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1329 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1331 *height = get_height;
1333 LOGD("ret : 0x%x", ret);
1337 int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
1339 if( camera == NULL){
1340 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1341 return CAMERA_ERROR_INVALID_PARAMETER;
1344 int ret = CAMERA_ERROR_NONE;
1345 camera_cli_s *pc = (camera_cli_s *)camera;
1346 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
1348 if (pc->cb_info == NULL) {
1349 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1350 return CAMERA_ERROR_INVALID_PARAMETER;
1352 sock_fd = pc->cb_info->fd;
1353 int set_rotation = (int)rotation;
1355 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1356 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
1357 LOGD("ret : 0x%x", ret);
1361 int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
1363 if( camera == NULL || rotation == NULL ){
1364 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1365 return CAMERA_ERROR_INVALID_PARAMETER;
1368 int ret = CAMERA_ERROR_NONE;
1370 camera_cli_s *pc = (camera_cli_s *)camera;
1371 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
1373 if (pc->cb_info == NULL) {
1374 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1375 return CAMERA_ERROR_INVALID_PARAMETER;
1377 sock_fd = pc->cb_info->fd;
1380 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1381 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1383 if (ret == CAMERA_ERROR_NONE) {
1384 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
1385 *rotation = (camera_rotation_e)get_rotation;
1387 LOGD("ret : 0x%x", ret);
1391 int camera_set_display_flip(camera_h camera, camera_flip_e flip)
1393 if( camera == NULL){
1394 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1395 return CAMERA_ERROR_INVALID_PARAMETER;
1398 int ret = CAMERA_ERROR_NONE;
1400 camera_cli_s *pc = (camera_cli_s *)camera;
1401 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
1403 if (pc->cb_info == NULL) {
1404 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1405 return CAMERA_ERROR_INVALID_PARAMETER;
1407 sock_fd = pc->cb_info->fd;
1408 int set_flip = (int)flip;
1410 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1411 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
1412 LOGD("ret : 0x%x", ret);
1416 int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
1418 if( camera == NULL || flip == NULL ){
1419 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1420 return CAMERA_ERROR_INVALID_PARAMETER;
1423 int ret = CAMERA_ERROR_NONE;
1425 camera_cli_s *pc = (camera_cli_s *)camera;
1426 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
1428 if (pc->cb_info == NULL) {
1429 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1430 return CAMERA_ERROR_INVALID_PARAMETER;
1432 sock_fd = pc->cb_info->fd;
1435 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1436 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1438 if (ret == CAMERA_ERROR_NONE) {
1439 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
1440 *flip = (camera_flip_e)get_flip;
1442 LOGD("ret : 0x%x", ret);
1446 int camera_set_display_visible(camera_h camera, bool visible)
1448 if( camera == NULL){
1449 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1450 return CAMERA_ERROR_INVALID_PARAMETER;
1453 int ret = CAMERA_ERROR_NONE;
1455 camera_cli_s *pc = (camera_cli_s *)camera;
1456 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
1457 int set_visible = (int)visible;
1459 if (pc->cb_info == NULL) {
1460 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1461 return CAMERA_ERROR_INVALID_PARAMETER;
1463 sock_fd = pc->cb_info->fd;
1465 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1466 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_visible);
1467 LOGD("ret : 0x%x", ret);
1471 int camera_is_display_visible(camera_h camera, bool* visible)
1473 if( camera == NULL || visible == NULL){
1474 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1475 return CAMERA_ERROR_INVALID_PARAMETER;
1478 int ret = CAMERA_ERROR_NONE;
1480 camera_cli_s *pc = (camera_cli_s *)camera;
1481 muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
1483 if (pc->cb_info == NULL) {
1484 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1485 return CAMERA_ERROR_INVALID_PARAMETER;
1487 sock_fd = pc->cb_info->fd;
1490 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1491 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1493 if (ret == CAMERA_ERROR_NONE) {
1494 muse_camera_msg_get(get_visible, pc->cb_info->recvMsg);
1495 *visible = (bool)get_visible;
1497 LOGD("ret : 0x%x", ret);
1501 int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
1503 if (camera == NULL) {
1504 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1505 return CAMERA_ERROR_INVALID_PARAMETER;
1508 int ret = CAMERA_ERROR_NONE;
1509 int set_mode = (int)mode;
1511 camera_cli_s *pc = (camera_cli_s *)camera;
1512 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
1514 if (pc->cb_info == NULL) {
1515 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1516 return CAMERA_ERROR_INVALID_PARAMETER;
1518 sock_fd = pc->cb_info->fd;
1520 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1521 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
1522 LOGD("ret : 0x%x", ret);
1526 int camera_get_display_mode(camera_h camera, camera_display_mode_e* mode)
1528 if( camera == NULL || mode == NULL){
1529 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1530 return CAMERA_ERROR_INVALID_PARAMETER;
1533 int ret = CAMERA_ERROR_NONE;
1535 camera_cli_s *pc = (camera_cli_s *)camera;
1536 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
1538 if (pc->cb_info == NULL) {
1539 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1540 return CAMERA_ERROR_INVALID_PARAMETER;
1542 sock_fd = pc->cb_info->fd;
1545 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1546 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1548 if (ret == CAMERA_ERROR_NONE) {
1549 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
1550 *mode = (camera_display_mode_e)get_mode;
1552 LOGD("ret : 0x%x", ret);
1556 int camera_get_capture_resolution(camera_h camera, int *width, int *height)
1558 if( camera == NULL || width== NULL || height == NULL){
1559 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1560 return CAMERA_ERROR_INVALID_PARAMETER;
1562 int ret = CAMERA_ERROR_NONE;
1564 camera_cli_s *pc = (camera_cli_s *)camera;
1565 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
1567 if (pc->cb_info == NULL) {
1568 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1569 return CAMERA_ERROR_INVALID_PARAMETER;
1571 sock_fd = pc->cb_info->fd;
1575 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1576 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1578 if (ret == CAMERA_ERROR_NONE) {
1579 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1580 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1582 *height = get_height;
1584 LOGD("ret : 0x%x", ret);
1588 int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
1590 if( camera == NULL || format == NULL){
1591 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1592 return CAMERA_ERROR_INVALID_PARAMETER;
1594 int ret = CAMERA_ERROR_NONE;
1596 camera_cli_s *pc = (camera_cli_s *)camera;
1597 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
1600 if (pc->cb_info == NULL) {
1601 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1602 return CAMERA_ERROR_INVALID_PARAMETER;
1604 sock_fd = pc->cb_info->fd;
1606 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1607 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1609 if (ret == CAMERA_ERROR_NONE) {
1610 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1611 *format = (camera_pixel_format_e)get_format;
1613 LOGD("ret : 0x%x", ret);
1617 int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
1619 if( camera == NULL || format == NULL){
1620 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1621 return CAMERA_ERROR_INVALID_PARAMETER;
1624 int ret = CAMERA_ERROR_NONE;
1626 camera_cli_s *pc = (camera_cli_s *)camera;
1627 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
1630 if (pc->cb_info == NULL) {
1631 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1632 return CAMERA_ERROR_INVALID_PARAMETER;
1634 sock_fd = pc->cb_info->fd;
1636 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1637 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1639 if (ret == CAMERA_ERROR_NONE) {
1640 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1641 *format = (camera_pixel_format_e)get_format;
1643 LOGD("ret : 0x%x", ret);
1647 int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void* user_data)
1649 if (camera == NULL || callback == NULL) {
1650 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1651 return CAMERA_ERROR_INVALID_PARAMETER;
1653 int ret = CAMERA_ERROR_NONE;
1655 camera_cli_s *pc = (camera_cli_s *)camera;
1657 if (pc->cb_info == NULL) {
1658 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1659 return CAMERA_ERROR_INVALID_PARAMETER;
1661 sock_fd = pc->cb_info->fd;
1662 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
1664 LOGD("Enter, handle :%x", pc->remote_handle);
1666 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = callback;
1667 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = user_data;
1669 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1670 LOGD("ret : 0x%x", ret);
1674 int camera_unset_preview_cb(camera_h camera)
1676 if (camera == NULL) {
1677 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1678 return CAMERA_ERROR_INVALID_PARAMETER;
1681 int ret = CAMERA_ERROR_NONE;
1683 camera_cli_s *pc = (camera_cli_s *)camera;
1684 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
1686 LOGD("Enter, handle :%x", pc->remote_handle);
1689 if (pc->cb_info == NULL) {
1690 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1691 return CAMERA_ERROR_INVALID_PARAMETER;
1693 sock_fd = pc->cb_info->fd;
1694 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1695 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1697 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1698 LOGD("ret : 0x%x", ret);
1702 int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void* user_data)
1704 if (camera == NULL) {
1705 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
1706 return CAMERA_ERROR_INVALID_PARAMETER;
1709 if (callback == NULL) {
1710 LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
1711 return CAMERA_ERROR_NOT_SUPPORTED;
1714 int ret = CAMERA_ERROR_NONE;
1716 camera_cli_s *pc = (camera_cli_s *)camera;
1717 muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
1719 LOGD("Enter, handle :%x", pc->remote_handle);
1722 if (pc->cb_info == NULL) {
1723 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1724 return CAMERA_ERROR_INVALID_PARAMETER;
1726 sock_fd = pc->cb_info->fd;
1727 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = callback;
1728 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = user_data;
1730 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1731 LOGD("ret : 0x%x", ret);
1735 int camera_unset_media_packet_preview_cb(camera_h camera)
1737 if (camera == NULL) {
1738 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1739 return CAMERA_ERROR_INVALID_PARAMETER;
1742 int ret = CAMERA_ERROR_NONE;
1744 camera_cli_s *pc = (camera_cli_s *)camera;
1745 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
1747 LOGD("Enter, handle :%x", pc->remote_handle);
1750 if (pc->cb_info == NULL) {
1751 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1752 return CAMERA_ERROR_INVALID_PARAMETER;
1754 sock_fd = pc->cb_info->fd;
1755 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1756 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1758 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1759 LOGD("ret : 0x%x", ret);
1763 int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void* user_data)
1765 if( camera == NULL || callback == NULL){
1766 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1767 return CAMERA_ERROR_INVALID_PARAMETER;
1769 int ret = CAMERA_ERROR_NONE;
1771 camera_cli_s *pc = (camera_cli_s *)camera;
1772 muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
1774 LOGD("Enter, handle :%x", pc->remote_handle);
1777 if (pc->cb_info == NULL) {
1778 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1779 return CAMERA_ERROR_INVALID_PARAMETER;
1781 sock_fd = pc->cb_info->fd;
1782 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = callback;
1783 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = user_data;
1785 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1786 LOGD("ret : 0x%x", ret);
1789 int camera_unset_state_changed_cb(camera_h camera)
1791 if( camera == NULL){
1792 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1793 return CAMERA_ERROR_INVALID_PARAMETER;
1795 int ret = CAMERA_ERROR_NONE;
1797 camera_cli_s *pc = (camera_cli_s *)camera;
1798 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
1800 LOGD("Enter, handle :%x", pc->remote_handle);
1803 if (pc->cb_info == NULL) {
1804 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1805 return CAMERA_ERROR_INVALID_PARAMETER;
1807 sock_fd = pc->cb_info->fd;
1808 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1809 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1811 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1812 LOGD("ret : 0x%x", ret);
1816 int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
1818 if( camera == NULL || callback == NULL){
1819 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1820 return CAMERA_ERROR_INVALID_PARAMETER;
1822 int ret = CAMERA_ERROR_NONE;
1824 camera_cli_s *pc = (camera_cli_s *)camera;
1825 muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
1827 LOGD("Enter, handle :%x", pc->remote_handle);
1830 if (pc->cb_info == NULL) {
1831 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1832 return CAMERA_ERROR_INVALID_PARAMETER;
1834 sock_fd = pc->cb_info->fd;
1835 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = callback;
1836 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = user_data;
1838 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1839 LOGD("ret : 0x%x", ret);
1843 int camera_unset_interrupted_cb(camera_h camera)
1845 if( camera == NULL){
1846 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1847 return CAMERA_ERROR_INVALID_PARAMETER;
1849 int ret = CAMERA_ERROR_NONE;
1851 camera_cli_s *pc = (camera_cli_s *)camera;
1852 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
1854 LOGD("Enter, handle :%x", pc->remote_handle);
1857 if (pc->cb_info == NULL) {
1858 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1859 return CAMERA_ERROR_INVALID_PARAMETER;
1861 sock_fd = pc->cb_info->fd;
1862 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1863 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1865 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1866 LOGD("ret : 0x%x", ret);
1870 int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void* user_data)
1872 if( camera == NULL || callback == NULL){
1873 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1874 return CAMERA_ERROR_INVALID_PARAMETER;
1876 int ret = CAMERA_ERROR_NONE;
1878 camera_cli_s *pc = (camera_cli_s *)camera;
1879 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
1881 LOGD("Enter, handle :%x", pc->remote_handle);
1884 if (pc->cb_info == NULL) {
1885 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1886 return CAMERA_ERROR_INVALID_PARAMETER;
1888 sock_fd = pc->cb_info->fd;
1889 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = callback;
1890 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = user_data;
1892 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1893 LOGD("ret : 0x%x", ret);
1897 int camera_unset_focus_changed_cb(camera_h camera)
1899 if( camera == NULL){
1900 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1901 return CAMERA_ERROR_INVALID_PARAMETER;
1903 int ret = CAMERA_ERROR_NONE;
1905 camera_cli_s *pc = (camera_cli_s *)camera;
1906 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
1908 LOGD("Enter, handle :%x", pc->remote_handle);
1911 if (pc->cb_info == NULL) {
1912 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1913 return CAMERA_ERROR_INVALID_PARAMETER;
1915 sock_fd = pc->cb_info->fd;
1916 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1917 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1919 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1920 LOGD("ret : 0x%x", ret);
1924 int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
1926 if( camera == NULL || callback == NULL){
1927 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1928 return CAMERA_ERROR_INVALID_PARAMETER;
1930 int ret = CAMERA_ERROR_NONE;
1932 camera_cli_s *pc = (camera_cli_s *)camera;
1933 muse_camera_api_e api = MUSE_CAMERA_API_SET_ERROR_CB;
1935 LOGD("Enter, handle :%x", pc->remote_handle);
1938 if (pc->cb_info == NULL) {
1939 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1940 return CAMERA_ERROR_INVALID_PARAMETER;
1942 sock_fd = pc->cb_info->fd;
1943 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = callback;
1944 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = user_data;
1946 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1947 LOGD("ret : 0x%x", ret);
1951 int camera_unset_error_cb(camera_h camera)
1953 if( camera == NULL){
1954 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1955 return CAMERA_ERROR_INVALID_PARAMETER;
1957 int ret = CAMERA_ERROR_NONE;
1959 camera_cli_s *pc = (camera_cli_s *)camera;
1960 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
1962 LOGD("Enter, handle :%x", pc->remote_handle);
1965 if (pc->cb_info == NULL) {
1966 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1967 return CAMERA_ERROR_INVALID_PARAMETER;
1969 sock_fd = pc->cb_info->fd;
1970 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1971 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1973 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1974 LOGD("ret : 0x%x", ret);
1978 int camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb , void *user_data)
1980 if( camera == NULL || foreach_cb == NULL){
1981 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1982 return CAMERA_ERROR_INVALID_PARAMETER;
1984 int ret = CAMERA_ERROR_NONE;
1986 camera_cli_s *pc = (camera_cli_s *)camera;
1987 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
1989 LOGD("Enter, handle :%x", pc->remote_handle);
1992 if (pc->cb_info == NULL) {
1993 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1994 return CAMERA_ERROR_INVALID_PARAMETER;
1996 sock_fd = pc->cb_info->fd;
1997 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
1998 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
2000 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2001 LOGD("ret : 0x%x", ret);
2005 int camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb , void *user_data)
2007 if( camera == NULL || foreach_cb == NULL){
2008 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2009 return CAMERA_ERROR_INVALID_PARAMETER;
2011 int ret = CAMERA_ERROR_NONE;
2013 camera_cli_s *pc = (camera_cli_s *)camera;
2014 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
2016 LOGD("Enter, handle :%x", pc->remote_handle);
2019 if (pc->cb_info == NULL) {
2020 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2021 return CAMERA_ERROR_INVALID_PARAMETER;
2023 sock_fd = pc->cb_info->fd;
2024 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
2025 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
2027 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2028 LOGD("ret : 0x%x", ret);
2032 int camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb , void *user_data)
2034 if( camera == NULL || foreach_cb == NULL){
2035 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2036 return CAMERA_ERROR_INVALID_PARAMETER;
2038 int ret = CAMERA_ERROR_NONE;
2040 camera_cli_s *pc = (camera_cli_s *)camera;
2041 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
2043 LOGD("Enter, handle :%x", pc->remote_handle);
2046 if (pc->cb_info == NULL) {
2047 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2048 return CAMERA_ERROR_INVALID_PARAMETER;
2050 sock_fd = pc->cb_info->fd;
2051 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
2052 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
2054 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2055 LOGD("ret : 0x%x", ret);
2060 int camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb , void *user_data)
2062 if( camera == NULL || foreach_cb == NULL){
2063 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2064 return CAMERA_ERROR_INVALID_PARAMETER;
2066 int ret = CAMERA_ERROR_NONE;
2068 camera_cli_s *pc = (camera_cli_s *)camera;
2069 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
2071 LOGD("Enter, handle :%x", pc->remote_handle);
2074 if (pc->cb_info == NULL) {
2075 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2076 return CAMERA_ERROR_INVALID_PARAMETER;
2078 sock_fd = pc->cb_info->fd;
2079 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
2080 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
2082 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2083 LOGD("ret : 0x%x", ret);
2088 int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
2090 if (camera == NULL || width == NULL || height == NULL) {
2091 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2092 return CAMERA_ERROR_INVALID_PARAMETER;
2094 int ret = CAMERA_ERROR_NONE;
2096 camera_cli_s *pc = (camera_cli_s *)camera;
2097 muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
2099 if (pc->cb_info == NULL) {
2100 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2101 return CAMERA_ERROR_INVALID_PARAMETER;
2103 sock_fd = pc->cb_info->fd;
2107 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2108 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2110 if (ret == CAMERA_ERROR_NONE) {
2111 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2112 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2114 *height = get_height;
2116 LOGD("ret : 0x%x", ret);
2121 int camera_attr_get_lens_orientation(camera_h camera, int *angle)
2123 if( camera == NULL || angle == NULL){
2124 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2125 return CAMERA_ERROR_INVALID_PARAMETER;
2127 int ret = CAMERA_ERROR_NONE;
2129 camera_cli_s *pc = (camera_cli_s *)camera;
2130 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
2132 if (pc->cb_info == NULL) {
2133 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2134 return CAMERA_ERROR_INVALID_PARAMETER;
2136 sock_fd = pc->cb_info->fd;
2139 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2140 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2142 if (ret == CAMERA_ERROR_NONE) {
2143 muse_camera_msg_get(get_angle, pc->cb_info->recvMsg);
2146 LOGD("ret : 0x%x", ret);
2150 int camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
2152 if (camera == NULL) {
2153 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2154 return CAMERA_ERROR_INVALID_PARAMETER;
2156 int ret = CAMERA_ERROR_NONE;
2157 camera_cli_s *pc = (camera_cli_s *)camera;
2158 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
2160 if (pc->cb_info == NULL) {
2161 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2162 return CAMERA_ERROR_INVALID_PARAMETER;
2164 sock_fd = pc->cb_info->fd;
2165 int set_mode = (int)mode;
2166 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2167 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2168 LOGD("ret : 0x%x", ret);
2172 int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
2174 if (camera == NULL || mode == NULL) {
2175 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2176 return CAMERA_ERROR_INVALID_PARAMETER;
2179 int ret = CAMERA_ERROR_NONE;
2180 camera_cli_s *pc = (camera_cli_s *)camera;
2181 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
2183 if (pc->cb_info == NULL) {
2184 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2185 return CAMERA_ERROR_INVALID_PARAMETER;
2187 sock_fd = pc->cb_info->fd;
2189 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2190 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2192 if (ret == CAMERA_ERROR_NONE) {
2193 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2194 *mode = (camera_attr_theater_mode_e)get_mode;
2196 LOGD("ret : 0x%x", ret);
2200 int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
2202 if (camera == NULL || foreach_cb == NULL) {
2203 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2204 return CAMERA_ERROR_INVALID_PARAMETER;
2206 int ret = CAMERA_ERROR_NONE;
2208 camera_cli_s *pc = (camera_cli_s *)camera;
2209 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE;
2211 LOGD("Enter, handle :%x", pc->remote_handle);
2214 if (pc->cb_info == NULL) {
2215 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2216 return CAMERA_ERROR_INVALID_PARAMETER;
2218 sock_fd = pc->cb_info->fd;
2219 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
2220 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
2222 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2224 LOGD("Finish, return :%x", ret);
2229 int camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
2231 if( camera == NULL){
2232 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2233 return CAMERA_ERROR_INVALID_PARAMETER;
2235 int ret = CAMERA_ERROR_NONE;
2236 camera_cli_s *pc = (camera_cli_s *)camera;
2237 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
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;
2244 int set_fps = (int)fps;
2245 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2246 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_fps);
2247 LOGD("ret : 0x%x", ret);
2252 int camera_attr_set_image_quality(camera_h camera, int quality)
2254 if( camera == NULL){
2255 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2256 return CAMERA_ERROR_INVALID_PARAMETER;
2258 int ret = CAMERA_ERROR_NONE;
2260 camera_cli_s *pc = (camera_cli_s *)camera;
2261 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
2263 if (pc->cb_info == NULL) {
2264 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2265 return CAMERA_ERROR_INVALID_PARAMETER;
2267 sock_fd = pc->cb_info->fd;
2268 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2269 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, quality);
2270 LOGD("ret : 0x%x", ret);
2274 int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
2276 if( camera == NULL || fps == NULL){
2277 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2278 return CAMERA_ERROR_INVALID_PARAMETER;
2280 int ret = CAMERA_ERROR_NONE;
2282 camera_cli_s *pc = (camera_cli_s *)camera;
2283 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
2286 if (pc->cb_info == NULL) {
2287 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2288 return CAMERA_ERROR_INVALID_PARAMETER;
2290 sock_fd = pc->cb_info->fd;
2292 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2293 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2295 if (ret == CAMERA_ERROR_NONE) {
2296 muse_camera_msg_get(get_fps, pc->cb_info->recvMsg);
2297 *fps = (camera_attr_fps_e)get_fps;
2299 LOGD("ret : 0x%x", ret);
2304 int camera_attr_get_image_quality(camera_h camera, int *quality)
2306 if( camera == NULL || quality == NULL){
2307 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2308 return CAMERA_ERROR_INVALID_PARAMETER;
2310 int ret = CAMERA_ERROR_NONE;
2312 camera_cli_s *pc = (camera_cli_s *)camera;
2313 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
2315 if (pc->cb_info == NULL) {
2316 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2317 return CAMERA_ERROR_INVALID_PARAMETER;
2319 sock_fd = pc->cb_info->fd;
2321 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2322 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2324 if (ret == CAMERA_ERROR_NONE) {
2325 muse_camera_msg_get(get_quality, pc->cb_info->recvMsg);
2326 *quality = get_quality;
2328 LOGD("ret : 0x%x", ret);
2333 int camera_attr_set_zoom(camera_h camera, int zoom)
2335 if( camera == NULL){
2336 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2337 return CAMERA_ERROR_INVALID_PARAMETER;
2339 int ret = CAMERA_ERROR_NONE;
2341 camera_cli_s *pc = (camera_cli_s *)camera;
2342 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
2344 if (pc->cb_info == NULL) {
2345 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2346 return CAMERA_ERROR_INVALID_PARAMETER;
2348 sock_fd = pc->cb_info->fd;
2350 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2351 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, zoom);
2352 LOGD("ret : 0x%x", ret);
2356 int camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
2358 if( camera == NULL){
2359 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2360 return CAMERA_ERROR_INVALID_PARAMETER;
2362 int ret = CAMERA_ERROR_NONE;
2364 camera_cli_s *pc = (camera_cli_s *)camera;
2365 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
2367 if (pc->cb_info == NULL) {
2368 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2369 return CAMERA_ERROR_INVALID_PARAMETER;
2371 sock_fd = pc->cb_info->fd;
2372 int set_mode = (int)mode;
2373 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2374 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2375 LOGD("ret : 0x%x", ret);
2379 int camera_attr_set_af_area(camera_h camera, int x, int y)
2381 if( camera == NULL){
2382 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2383 return CAMERA_ERROR_INVALID_PARAMETER;
2385 int ret = CAMERA_ERROR_NONE;
2386 camera_cli_s *pc = (camera_cli_s *)camera;
2387 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
2388 int sock_fd = pc->cb_info->fd;
2389 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2390 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, x, INT, y);
2391 LOGD("ret : 0x%x", ret);
2396 int camera_attr_clear_af_area(camera_h camera)
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_CLEAR_AF_AREA;
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 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2413 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2414 LOGD("ret : 0x%x", ret);
2419 int camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode)
2421 if( camera == NULL){
2422 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2423 return CAMERA_ERROR_INVALID_PARAMETER;
2426 if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
2427 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
2428 return CAMERA_ERROR_NOT_SUPPORTED;
2431 int ret = CAMERA_ERROR_NONE;
2432 camera_cli_s *pc = (camera_cli_s *)camera;
2433 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
2434 int set_mode = (int)mode;
2436 if (pc->cb_info == NULL) {
2437 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2438 return CAMERA_ERROR_INVALID_PARAMETER;
2440 sock_fd = pc->cb_info->fd;
2441 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2442 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2443 LOGD("ret : 0x%x", ret);
2448 int camera_attr_set_exposure(camera_h camera, int value)
2450 if( camera == NULL){
2451 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2452 return CAMERA_ERROR_INVALID_PARAMETER;
2454 int ret = CAMERA_ERROR_NONE;
2456 camera_cli_s *pc = (camera_cli_s *)camera;
2457 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
2459 if (pc->cb_info == NULL) {
2460 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2461 return CAMERA_ERROR_INVALID_PARAMETER;
2463 sock_fd = pc->cb_info->fd;
2465 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2466 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, value);
2467 LOGD("ret : 0x%x", ret);
2472 int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
2474 if( camera == NULL){
2475 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2476 return CAMERA_ERROR_INVALID_PARAMETER;
2478 int ret = CAMERA_ERROR_NONE;
2480 camera_cli_s *pc = (camera_cli_s *)camera;
2481 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
2483 if (pc->cb_info == NULL) {
2484 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2485 return CAMERA_ERROR_INVALID_PARAMETER;
2487 sock_fd = pc->cb_info->fd;
2488 int set_iso = (int)iso;
2489 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2490 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_iso);
2491 LOGD("ret : 0x%x", ret);
2496 int camera_attr_set_brightness(camera_h camera, int level)
2498 if( camera == NULL){
2499 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2500 return CAMERA_ERROR_INVALID_PARAMETER;
2502 int ret = CAMERA_ERROR_NONE;
2504 camera_cli_s *pc = (camera_cli_s *)camera;
2505 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
2507 if (pc->cb_info == NULL) {
2508 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2509 return CAMERA_ERROR_INVALID_PARAMETER;
2511 sock_fd = pc->cb_info->fd;
2513 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2514 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2515 LOGD("ret : 0x%x", ret);
2520 int camera_attr_set_contrast(camera_h camera, int level)
2522 if( camera == NULL){
2523 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2524 return CAMERA_ERROR_INVALID_PARAMETER;
2526 int ret = CAMERA_ERROR_NONE;
2528 camera_cli_s *pc = (camera_cli_s *)camera;
2529 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_CONTRAST;
2531 if (pc->cb_info == NULL) {
2532 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2533 return CAMERA_ERROR_INVALID_PARAMETER;
2535 sock_fd = pc->cb_info->fd;
2537 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2538 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2539 LOGD("ret : 0x%x", ret);
2544 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
2546 if (camera == NULL) {
2547 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2548 return CAMERA_ERROR_INVALID_PARAMETER;
2551 if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
2552 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_NOT_SUPPORTED);
2553 return CAMERA_ERROR_NOT_SUPPORTED;
2556 int ret = CAMERA_ERROR_NONE;
2558 camera_cli_s *pc = (camera_cli_s *)camera;
2559 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
2561 if (pc->cb_info == NULL) {
2562 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2563 return CAMERA_ERROR_INVALID_PARAMETER;
2565 sock_fd = pc->cb_info->fd;
2566 int set_whitebalance = (int)wb;
2567 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2568 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_whitebalance);
2569 LOGD("ret : 0x%x", ret);
2574 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
2576 if( camera == NULL){
2577 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2578 return CAMERA_ERROR_INVALID_PARAMETER;
2580 int ret = CAMERA_ERROR_NONE;
2582 camera_cli_s *pc = (camera_cli_s *)camera;
2583 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
2585 if (pc->cb_info == NULL) {
2586 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2587 return CAMERA_ERROR_INVALID_PARAMETER;
2589 sock_fd = pc->cb_info->fd;
2590 int set_effect = (int)effect;
2591 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2592 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_effect);
2593 LOGD("ret : 0x%x", ret);
2598 int camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
2600 if( camera == NULL){
2601 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2602 return CAMERA_ERROR_INVALID_PARAMETER;
2604 int ret = CAMERA_ERROR_NONE;
2606 camera_cli_s *pc = (camera_cli_s *)camera;
2607 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
2609 if (pc->cb_info == NULL) {
2610 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2611 return CAMERA_ERROR_INVALID_PARAMETER;
2613 sock_fd = pc->cb_info->fd;
2614 int set_mode = (int)mode;
2615 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2616 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2617 LOGD("ret : 0x%x", ret);
2622 int camera_attr_enable_tag(camera_h camera, bool enable)
2624 if( camera == NULL){
2625 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2626 return CAMERA_ERROR_INVALID_PARAMETER;
2628 int ret = CAMERA_ERROR_NONE;
2629 camera_cli_s *pc = (camera_cli_s *)camera;
2630 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
2632 if (pc->cb_info == NULL) {
2633 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2634 return CAMERA_ERROR_INVALID_PARAMETER;
2636 sock_fd = pc->cb_info->fd;
2637 int set_enable = (int)enable;
2639 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2640 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
2641 LOGD("ret : 0x%x", ret);
2646 int camera_attr_set_tag_image_description(camera_h camera, const char *description)
2648 if( camera == NULL){
2649 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2650 return CAMERA_ERROR_INVALID_PARAMETER;
2652 if( description == NULL){
2653 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2654 return CAMERA_ERROR_INVALID_PARAMETER;
2656 int ret = CAMERA_ERROR_NONE;
2657 camera_cli_s *pc = (camera_cli_s *)camera;
2658 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
2660 if (pc->cb_info == NULL) {
2661 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2662 return CAMERA_ERROR_INVALID_PARAMETER;
2664 sock_fd = pc->cb_info->fd;
2665 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2666 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, description);
2667 LOGD("ret : 0x%x", ret);
2672 int camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation)
2674 if( camera == NULL){
2675 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2676 return CAMERA_ERROR_INVALID_PARAMETER;
2678 int ret = CAMERA_ERROR_NONE;
2679 camera_cli_s *pc = (camera_cli_s *)camera;
2680 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
2682 if (pc->cb_info == NULL) {
2683 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2684 return CAMERA_ERROR_INVALID_PARAMETER;
2686 sock_fd = pc->cb_info->fd;
2687 int set_orientation = (int)orientation;
2689 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2690 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_orientation);
2691 LOGD("ret : 0x%x", ret);
2696 int camera_attr_set_tag_software(camera_h camera, const char *software)
2698 if( camera == NULL){
2699 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2700 return CAMERA_ERROR_INVALID_PARAMETER;
2702 if( software == NULL){
2703 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2704 return CAMERA_ERROR_INVALID_PARAMETER;
2706 int ret = CAMERA_ERROR_NONE;
2707 camera_cli_s *pc = (camera_cli_s *)camera;
2708 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
2710 if (pc->cb_info == NULL) {
2711 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2712 return CAMERA_ERROR_INVALID_PARAMETER;
2714 sock_fd = pc->cb_info->fd;
2715 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2716 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, software);
2717 LOGD("ret : 0x%x", ret);
2722 int camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
2724 if( camera == NULL){
2725 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2726 return CAMERA_ERROR_INVALID_PARAMETER;
2728 int ret = CAMERA_ERROR_NONE;
2729 camera_cli_s *pc = (camera_cli_s *)camera;
2730 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
2732 if (pc->cb_info == NULL) {
2733 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2734 return CAMERA_ERROR_INVALID_PARAMETER;
2736 sock_fd = pc->cb_info->fd;
2737 double set_geotag[3] = { latitude, longitude, altitude };
2739 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2740 muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
2741 set_geotag, sizeof(set_geotag), sizeof(double));
2742 LOGD("ret : 0x%x", ret);
2747 int camera_attr_remove_geotag(camera_h camera)
2749 if( camera == 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;
2755 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
2757 if (pc->cb_info == NULL) {
2758 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2759 return CAMERA_ERROR_INVALID_PARAMETER;
2761 sock_fd = pc->cb_info->fd;
2762 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2763 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2764 LOGD("ret : 0x%x", ret);
2769 int camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
2771 if( camera == NULL){
2772 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2773 return CAMERA_ERROR_INVALID_PARAMETER;
2775 int ret = CAMERA_ERROR_NONE;
2776 camera_cli_s *pc = (camera_cli_s *)camera;
2777 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
2779 if (pc->cb_info == NULL) {
2780 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2781 return CAMERA_ERROR_INVALID_PARAMETER;
2783 sock_fd = pc->cb_info->fd;
2784 int set_mode = (int)mode;
2786 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2787 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2788 LOGD("ret : 0x%x", ret);
2793 int camera_attr_get_zoom(camera_h camera, int *zoom)
2795 if( camera == NULL || zoom == NULL){
2796 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2797 return CAMERA_ERROR_INVALID_PARAMETER;
2799 int ret = CAMERA_ERROR_NONE;
2801 camera_cli_s *pc = (camera_cli_s *)camera;
2802 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
2805 if (pc->cb_info == NULL) {
2806 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2807 return CAMERA_ERROR_INVALID_PARAMETER;
2809 sock_fd = pc->cb_info->fd;
2811 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2812 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2814 if (ret == CAMERA_ERROR_NONE) {
2815 muse_camera_msg_get(get_zoom, pc->cb_info->recvMsg);
2818 LOGD("ret : 0x%x", ret);
2823 int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
2825 if( camera == NULL || min == NULL || max == NULL ){
2826 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2827 return CAMERA_ERROR_INVALID_PARAMETER;
2829 int ret = CAMERA_ERROR_NONE;
2830 camera_cli_s *pc = (camera_cli_s *)camera;
2832 if (pc->cb_info == NULL) {
2833 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2834 return CAMERA_ERROR_INVALID_PARAMETER;
2836 sock_fd = pc->cb_info->fd;
2837 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
2841 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2842 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2844 if (ret == CAMERA_ERROR_NONE) {
2845 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2846 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2850 LOGD("ret : 0x%x", ret);
2855 int camera_attr_get_af_mode( camera_h camera, camera_attr_af_mode_e *mode)
2857 if( camera == NULL || mode == NULL){
2858 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2859 return CAMERA_ERROR_INVALID_PARAMETER;
2861 int ret = CAMERA_ERROR_NONE;
2862 camera_cli_s *pc = (camera_cli_s *)camera;
2864 if (pc->cb_info == NULL) {
2865 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2866 return CAMERA_ERROR_INVALID_PARAMETER;
2868 sock_fd = pc->cb_info->fd;
2869 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
2872 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2873 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2875 if (ret == CAMERA_ERROR_NONE) {
2876 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2877 *mode = (camera_attr_af_mode_e)get_mode;
2879 LOGD("ret : 0x%x", ret);
2884 int camera_attr_get_exposure_mode( camera_h camera, camera_attr_exposure_mode_e *mode)
2886 if( camera == NULL|| mode == NULL){
2887 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2888 return CAMERA_ERROR_INVALID_PARAMETER;
2890 int ret = CAMERA_ERROR_NONE;
2891 camera_cli_s *pc = (camera_cli_s *)camera;
2893 if (pc->cb_info == NULL) {
2894 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2895 return CAMERA_ERROR_INVALID_PARAMETER;
2897 sock_fd = pc->cb_info->fd;
2898 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
2901 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2902 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2904 if (ret == CAMERA_ERROR_NONE) {
2905 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2906 *mode = (camera_attr_exposure_mode_e)get_mode;
2908 LOGD("ret : 0x%x", ret);
2912 int camera_attr_get_exposure(camera_h camera, int *value)
2914 if( camera == NULL || value == NULL){
2915 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2916 return CAMERA_ERROR_INVALID_PARAMETER;
2918 int ret = CAMERA_ERROR_NONE;
2919 camera_cli_s *pc = (camera_cli_s *)camera;
2921 if (pc->cb_info == NULL) {
2922 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2923 return CAMERA_ERROR_INVALID_PARAMETER;
2925 sock_fd = pc->cb_info->fd;
2926 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
2929 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2930 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2932 if (ret == CAMERA_ERROR_NONE) {
2933 muse_camera_msg_get(get_value, pc->cb_info->recvMsg);
2936 LOGD("ret : 0x%x", ret);
2941 int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
2943 if( camera == NULL || min == NULL || max == NULL ){
2944 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2945 return CAMERA_ERROR_INVALID_PARAMETER;
2947 int ret = CAMERA_ERROR_NONE;
2948 camera_cli_s *pc = (camera_cli_s *)camera;
2950 if (pc->cb_info == NULL) {
2951 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2952 return CAMERA_ERROR_INVALID_PARAMETER;
2954 sock_fd = pc->cb_info->fd;
2955 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
2959 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2960 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2962 if (ret == CAMERA_ERROR_NONE) {
2963 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2964 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2968 LOGD("ret : 0x%x", ret);
2973 int camera_attr_get_iso( camera_h camera, camera_attr_iso_e *iso)
2975 if( camera == NULL || iso == NULL){
2976 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2977 return CAMERA_ERROR_INVALID_PARAMETER;
2979 int ret = CAMERA_ERROR_NONE;
2980 camera_cli_s *pc = (camera_cli_s *)camera;
2982 if (pc->cb_info == NULL) {
2983 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2984 return CAMERA_ERROR_INVALID_PARAMETER;
2986 sock_fd = pc->cb_info->fd;
2987 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
2990 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2991 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2993 if (ret == CAMERA_ERROR_NONE) {
2994 muse_camera_msg_get(get_iso, pc->cb_info->recvMsg);
2995 *iso = (camera_attr_iso_e)get_iso;
2997 LOGD("ret : 0x%x", ret);
3002 int camera_attr_get_brightness(camera_h camera, int *level)
3004 if( camera == NULL || level == NULL){
3005 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3006 return CAMERA_ERROR_INVALID_PARAMETER;
3008 int ret = CAMERA_ERROR_NONE;
3009 camera_cli_s *pc = (camera_cli_s *)camera;
3011 if (pc->cb_info == NULL) {
3012 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3013 return CAMERA_ERROR_INVALID_PARAMETER;
3015 sock_fd = pc->cb_info->fd;
3016 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
3019 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3020 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3022 if (ret == CAMERA_ERROR_NONE) {
3023 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3026 LOGD("ret : 0x%x", ret);
3031 int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
3033 if( camera == NULL || min == NULL || max == NULL ){
3034 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3035 return CAMERA_ERROR_INVALID_PARAMETER;
3037 int ret = CAMERA_ERROR_NONE;
3038 camera_cli_s *pc = (camera_cli_s *)camera;
3040 if (pc->cb_info == NULL) {
3041 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3042 return CAMERA_ERROR_INVALID_PARAMETER;
3044 sock_fd = pc->cb_info->fd;
3045 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
3049 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3050 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3052 if (ret == CAMERA_ERROR_NONE) {
3053 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3054 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3058 LOGD("ret : 0x%x", ret);
3063 int camera_attr_get_contrast(camera_h camera, int *level)
3065 if( camera == NULL || level == NULL){
3066 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3067 return CAMERA_ERROR_INVALID_PARAMETER;
3069 int ret = CAMERA_ERROR_NONE;
3070 camera_cli_s *pc = (camera_cli_s *)camera;
3071 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
3073 if (pc->cb_info == NULL) {
3074 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3075 return CAMERA_ERROR_INVALID_PARAMETER;
3077 sock_fd = pc->cb_info->fd;
3080 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3081 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3083 if (ret == CAMERA_ERROR_NONE) {
3084 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3087 LOGD("ret : 0x%x", ret);
3092 int camera_attr_get_contrast_range(camera_h camera, int *min , int *max)
3094 if( camera == NULL || min == NULL || max == NULL ){
3095 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3096 return CAMERA_ERROR_INVALID_PARAMETER;
3098 int ret = CAMERA_ERROR_NONE;
3099 camera_cli_s *pc = (camera_cli_s *)camera;
3100 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
3102 if (pc->cb_info == NULL) {
3103 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3104 return CAMERA_ERROR_INVALID_PARAMETER;
3106 sock_fd = pc->cb_info->fd;
3110 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3111 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3113 if (ret == CAMERA_ERROR_NONE) {
3114 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3115 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3119 LOGD("ret : 0x%x", ret);
3124 int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
3126 if( camera == NULL || wb == NULL){
3127 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3128 return CAMERA_ERROR_INVALID_PARAMETER;
3130 int ret = CAMERA_ERROR_NONE;
3131 camera_cli_s *pc = (camera_cli_s *)camera;
3132 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
3134 if (pc->cb_info == NULL) {
3135 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3136 return CAMERA_ERROR_INVALID_PARAMETER;
3138 sock_fd = pc->cb_info->fd;
3141 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3142 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3144 if (ret == CAMERA_ERROR_NONE) {
3145 muse_camera_msg_get(get_wb, pc->cb_info->recvMsg);
3146 *wb = (camera_attr_whitebalance_e)get_wb;
3148 LOGD("ret : 0x%x", ret);
3153 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
3155 if( camera == NULL || effect == NULL ){
3156 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3157 return CAMERA_ERROR_INVALID_PARAMETER;
3160 int ret = CAMERA_ERROR_NONE;
3161 camera_cli_s *pc = (camera_cli_s *)camera;
3162 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
3164 if (pc->cb_info == NULL) {
3165 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3166 return CAMERA_ERROR_INVALID_PARAMETER;
3168 sock_fd = pc->cb_info->fd;
3171 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3172 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3174 if (ret == CAMERA_ERROR_NONE) {
3175 muse_camera_msg_get(get_effect, pc->cb_info->recvMsg);
3176 *effect = (camera_attr_effect_mode_e)get_effect;
3178 LOGD("ret : 0x%x", ret);
3183 int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
3185 if( camera == NULL || mode == NULL){
3186 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3187 return CAMERA_ERROR_INVALID_PARAMETER;
3190 int ret = CAMERA_ERROR_NONE;
3191 camera_cli_s *pc = (camera_cli_s *)camera;
3192 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
3194 if (pc->cb_info == NULL) {
3195 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3196 return CAMERA_ERROR_INVALID_PARAMETER;
3198 sock_fd = pc->cb_info->fd;
3201 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3202 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3204 if (ret == CAMERA_ERROR_NONE) {
3205 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3206 *mode = (camera_attr_scene_mode_e)get_mode;
3208 LOGD("ret : 0x%x", ret);
3213 int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
3215 if( camera == NULL || enable == NULL){
3216 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3217 return CAMERA_ERROR_INVALID_PARAMETER;
3220 int ret = CAMERA_ERROR_NONE;
3221 camera_cli_s *pc = (camera_cli_s *)camera;
3222 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
3224 if (pc->cb_info == NULL) {
3225 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3226 return CAMERA_ERROR_INVALID_PARAMETER;
3228 sock_fd = pc->cb_info->fd;
3231 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3232 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3234 if (ret == CAMERA_ERROR_NONE) {
3235 muse_camera_msg_get(get_enable, pc->cb_info->recvMsg);
3236 *enable = (bool)get_enable;
3238 LOGD("ret : 0x%x", ret);
3243 int camera_attr_get_tag_image_description(camera_h camera, char **description)
3245 if( camera == NULL || description == NULL){
3246 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3247 return CAMERA_ERROR_INVALID_PARAMETER;
3250 int ret = CAMERA_ERROR_NONE;
3251 camera_cli_s *pc = (camera_cli_s *)camera;
3252 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
3254 if (pc->cb_info == NULL) {
3255 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3256 return CAMERA_ERROR_INVALID_PARAMETER;
3258 sock_fd = pc->cb_info->fd;
3259 char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3261 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3262 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3264 if (ret == CAMERA_ERROR_NONE) {
3265 muse_camera_msg_get_string(get_description, pc->cb_info->recvMsg);
3266 *description = strdup(get_description);
3268 LOGD("ret : 0x%x", ret);
3273 int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
3275 if( camera == NULL || orientation == NULL){
3276 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3277 return CAMERA_ERROR_INVALID_PARAMETER;
3280 int ret = CAMERA_ERROR_NONE;
3281 camera_cli_s *pc = (camera_cli_s *)camera;
3282 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
3284 if (pc->cb_info == NULL) {
3285 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3286 return CAMERA_ERROR_INVALID_PARAMETER;
3288 sock_fd = pc->cb_info->fd;
3289 int get_orientation;
3291 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3292 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3294 if (ret == CAMERA_ERROR_NONE) {
3295 muse_camera_msg_get(get_orientation, pc->cb_info->recvMsg);
3296 *orientation = (camera_attr_tag_orientation_e)get_orientation;
3297 LOGD("success, orientation : %d", *orientation);
3299 LOGD("ret : 0x%x", ret);
3304 int camera_attr_get_tag_software(camera_h camera, char **software)
3306 if( camera == NULL || software == NULL ){
3307 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3308 return CAMERA_ERROR_INVALID_PARAMETER;
3311 int ret = CAMERA_ERROR_NONE;
3312 camera_cli_s *pc = (camera_cli_s *)camera;
3313 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
3315 if (pc->cb_info == NULL) {
3316 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3317 return CAMERA_ERROR_INVALID_PARAMETER;
3319 sock_fd = pc->cb_info->fd;
3320 char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3322 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3323 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3325 if (ret == CAMERA_ERROR_NONE) {
3326 muse_camera_msg_get_string(get_software, pc->cb_info->recvMsg);
3327 *software = strdup(get_software);
3329 LOGD("ret : 0x%x", ret);
3334 int camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
3336 if( camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL){
3337 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3338 return CAMERA_ERROR_INVALID_PARAMETER;
3341 int ret = CAMERA_ERROR_NONE;
3342 camera_cli_s *pc = (camera_cli_s *)camera;
3343 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
3344 double get_geotag[3] = {0,};
3346 if (pc->cb_info == NULL) {
3347 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3348 return CAMERA_ERROR_INVALID_PARAMETER;
3350 sock_fd = pc->cb_info->fd;
3352 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3353 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3355 if (ret == CAMERA_ERROR_NONE) {
3356 muse_camera_msg_get_array(get_geotag, pc->cb_info->recvMsg);
3357 *latitude = get_geotag[0];
3358 *longitude = get_geotag[1];
3359 *altitude = get_geotag[2];
3361 LOGE("Returned value is not valid : 0x%x", valid);
3366 LOGD("ret : 0x%x", ret);
3371 int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
3373 if( camera == NULL || mode == NULL){
3374 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3375 return CAMERA_ERROR_INVALID_PARAMETER;
3378 int ret = CAMERA_ERROR_NONE;
3379 camera_cli_s *pc = (camera_cli_s *)camera;
3380 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
3382 if (pc->cb_info == NULL) {
3383 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3384 return CAMERA_ERROR_INVALID_PARAMETER;
3386 sock_fd = pc->cb_info->fd;
3389 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3390 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3392 if (ret == CAMERA_ERROR_NONE) {
3393 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3394 *mode = (camera_attr_flash_mode_e)get_mode;
3396 LOGD("ret : 0x%x", ret);
3401 int camera_attr_foreach_supported_af_mode( camera_h camera, camera_attr_supported_af_mode_cb foreach_cb , void *user_data)
3403 if( camera == NULL || foreach_cb == NULL){
3404 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3405 return CAMERA_ERROR_INVALID_PARAMETER;
3407 int ret = CAMERA_ERROR_NONE;
3409 camera_cli_s *pc = (camera_cli_s *)camera;
3410 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
3412 LOGD("Enter, handle :%x", pc->remote_handle);
3415 if (pc->cb_info == NULL) {
3416 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3417 return CAMERA_ERROR_INVALID_PARAMETER;
3419 sock_fd = pc->cb_info->fd;
3420 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
3421 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
3423 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3424 LOGD("ret : 0x%x", ret);
3429 int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb , void *user_data)
3431 if( camera == NULL || foreach_cb == NULL){
3432 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3433 return CAMERA_ERROR_INVALID_PARAMETER;
3435 int ret = CAMERA_ERROR_NONE;
3437 camera_cli_s *pc = (camera_cli_s *)camera;
3438 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
3440 LOGD("Enter, handle :%x", pc->remote_handle);
3443 if (pc->cb_info == NULL) {
3444 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3445 return CAMERA_ERROR_INVALID_PARAMETER;
3447 sock_fd = pc->cb_info->fd;
3448 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
3449 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
3451 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3452 LOGD("ret : 0x%x", ret);
3457 int camera_attr_foreach_supported_iso( camera_h camera, camera_attr_supported_iso_cb foreach_cb , void *user_data)
3459 if( camera == NULL || foreach_cb == NULL){
3460 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3461 return CAMERA_ERROR_INVALID_PARAMETER;
3463 int ret = CAMERA_ERROR_NONE;
3465 camera_cli_s *pc = (camera_cli_s *)camera;
3466 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
3468 LOGD("Enter, handle :%x", pc->remote_handle);
3471 if (pc->cb_info == NULL) {
3472 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3473 return CAMERA_ERROR_INVALID_PARAMETER;
3475 sock_fd = pc->cb_info->fd;
3476 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
3477 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
3479 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3480 LOGD("ret : 0x%x", ret);
3485 int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb , void *user_data)
3487 if( camera == NULL || foreach_cb == NULL){
3488 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3489 return CAMERA_ERROR_INVALID_PARAMETER;
3491 int ret = CAMERA_ERROR_NONE;
3493 camera_cli_s *pc = (camera_cli_s *)camera;
3494 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
3496 LOGD("Enter, handle :%x", pc->remote_handle);
3499 if (pc->cb_info == NULL) {
3500 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3501 return CAMERA_ERROR_INVALID_PARAMETER;
3503 sock_fd = pc->cb_info->fd;
3504 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
3505 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
3507 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3508 LOGD("ret : 0x%x", ret);
3513 int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb , void *user_data)
3515 if( camera == NULL || foreach_cb == NULL){
3516 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3517 return CAMERA_ERROR_INVALID_PARAMETER;
3519 int ret = CAMERA_ERROR_NONE;
3521 camera_cli_s *pc = (camera_cli_s *)camera;
3522 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
3524 LOGD("Enter, handle :%x", pc->remote_handle);
3527 if (pc->cb_info == NULL) {
3528 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3529 return CAMERA_ERROR_INVALID_PARAMETER;
3531 sock_fd = pc->cb_info->fd;
3532 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
3533 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
3535 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3536 LOGD("ret : 0x%x", ret);
3541 int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb , void *user_data)
3543 if( camera == NULL || foreach_cb == NULL){
3544 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3545 return CAMERA_ERROR_INVALID_PARAMETER;
3547 int ret = CAMERA_ERROR_NONE;
3549 camera_cli_s *pc = (camera_cli_s *)camera;
3550 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
3552 LOGD("Enter, handle :%x", pc->remote_handle);
3555 if (pc->cb_info == NULL) {
3556 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3557 return CAMERA_ERROR_INVALID_PARAMETER;
3559 sock_fd = pc->cb_info->fd;
3560 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
3561 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
3563 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3564 LOGD("ret : 0x%x", ret);
3569 int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb , void *user_data)
3571 if( camera == NULL || foreach_cb == NULL){
3572 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3573 return CAMERA_ERROR_INVALID_PARAMETER;
3575 int ret = CAMERA_ERROR_NONE;
3577 camera_cli_s *pc = (camera_cli_s *)camera;
3578 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
3580 LOGD("Enter, handle :%x", pc->remote_handle);
3583 if (pc->cb_info == NULL) {
3584 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3585 return CAMERA_ERROR_INVALID_PARAMETER;
3587 sock_fd = pc->cb_info->fd;
3588 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
3589 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = 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_fps(camera_h camera, camera_attr_supported_fps_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_FPS;
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_FPS] = foreach_cb;
3615 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
3617 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3618 LOGD("Enter, handle :%x", pc->remote_handle);
3622 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)
3624 if( camera == NULL || foreach_cb == NULL){
3625 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3626 return CAMERA_ERROR_INVALID_PARAMETER;
3628 int ret = CAMERA_ERROR_NONE;
3630 camera_cli_s *pc = (camera_cli_s *)camera;
3631 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
3633 if (pc->cb_info == NULL) {
3634 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3635 return CAMERA_ERROR_INVALID_PARAMETER;
3637 sock_fd = pc->cb_info->fd;
3638 LOGD("Enter, handle :%x", pc->remote_handle);
3639 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = foreach_cb;
3640 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = user_data;
3642 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
3643 LOGD("ret : 0x%x", ret);
3647 int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
3649 if( camera == NULL || foreach_cb == NULL){
3650 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3651 return CAMERA_ERROR_INVALID_PARAMETER;
3653 int ret = CAMERA_ERROR_NONE;
3655 camera_cli_s *pc = (camera_cli_s *)camera;
3656 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
3658 if (pc->cb_info == NULL) {
3659 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3660 return CAMERA_ERROR_INVALID_PARAMETER;
3662 sock_fd = pc->cb_info->fd;
3663 LOGD("Enter, handle :%x", pc->remote_handle);
3664 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
3665 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
3667 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3668 LOGD("ret : 0x%x", ret);
3673 int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
3675 if( camera == NULL || foreach_cb == NULL){
3676 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3677 return CAMERA_ERROR_INVALID_PARAMETER;
3679 int ret = CAMERA_ERROR_NONE;
3681 camera_cli_s *pc = (camera_cli_s *)camera;
3682 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION;
3684 if (pc->cb_info == NULL) {
3685 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3686 return CAMERA_ERROR_INVALID_PARAMETER;
3688 sock_fd = pc->cb_info->fd;
3689 LOGD("Enter, handle :%x", pc->remote_handle);
3690 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
3691 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
3693 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3694 LOGD("ret : 0x%x", ret);
3699 int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation)
3701 if( camera == NULL){
3702 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3703 return CAMERA_ERROR_INVALID_PARAMETER;
3706 int ret = CAMERA_ERROR_NONE;
3707 camera_cli_s *pc = (camera_cli_s *)camera;
3708 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
3710 if (pc->cb_info == NULL) {
3711 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3712 return CAMERA_ERROR_INVALID_PARAMETER;
3714 sock_fd = pc->cb_info->fd;
3715 int set_rotation = (int)rotation;
3717 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3718 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
3719 LOGD("ret : 0x%x", ret);
3724 int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation)
3726 if( camera == NULL || rotation == NULL ){
3727 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3728 return CAMERA_ERROR_INVALID_PARAMETER;
3731 int ret = CAMERA_ERROR_NONE;
3732 camera_cli_s *pc = (camera_cli_s *)camera;
3733 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
3735 if (pc->cb_info == NULL) {
3736 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3737 return CAMERA_ERROR_INVALID_PARAMETER;
3739 sock_fd = pc->cb_info->fd;
3742 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3743 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3745 if (ret == CAMERA_ERROR_NONE) {
3746 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
3747 *rotation = (camera_rotation_e)get_rotation;
3749 LOGD("ret : 0x%x", ret);
3754 int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip)
3756 if( camera == NULL){
3757 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3758 return CAMERA_ERROR_INVALID_PARAMETER;
3761 int ret = CAMERA_ERROR_NONE;
3762 camera_cli_s *pc = (camera_cli_s *)camera;
3763 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
3765 if (pc->cb_info == NULL) {
3766 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3767 return CAMERA_ERROR_INVALID_PARAMETER;
3769 sock_fd = pc->cb_info->fd;
3770 int set_flip = (int)flip;
3772 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3773 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
3774 LOGD("ret : 0x%x", ret);
3779 int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip)
3781 if( camera == NULL || flip == NULL ){
3782 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3783 return CAMERA_ERROR_INVALID_PARAMETER;
3786 int ret = CAMERA_ERROR_NONE;
3787 camera_cli_s *pc = (camera_cli_s *)camera;
3788 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
3790 if (pc->cb_info == NULL) {
3791 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3792 return CAMERA_ERROR_INVALID_PARAMETER;
3794 sock_fd = pc->cb_info->fd;
3797 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3798 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3800 if (ret == CAMERA_ERROR_NONE) {
3801 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
3802 *flip = (camera_flip_e)get_flip;
3804 LOGD("ret : 0x%x", ret);
3808 int camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
3810 if( camera == NULL){
3811 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3812 return CAMERA_ERROR_INVALID_PARAMETER;
3815 int ret = CAMERA_ERROR_NONE;
3816 camera_cli_s *pc = (camera_cli_s *)camera;
3817 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
3819 if (pc->cb_info == NULL) {
3820 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3821 return CAMERA_ERROR_INVALID_PARAMETER;
3823 sock_fd = pc->cb_info->fd;
3824 int set_mode = (int)mode;
3826 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3827 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3828 LOGD("ret : 0x%x", ret);
3833 int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
3835 if (camera == NULL) {
3836 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
3837 return CAMERA_ERROR_INVALID_PARAMETER;
3840 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - mode",CAMERA_ERROR_NOT_SUPPORTED);
3841 return CAMERA_ERROR_NOT_SUPPORTED;
3843 int ret = CAMERA_ERROR_NONE;
3844 camera_cli_s *pc = (camera_cli_s *)camera;
3845 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
3847 if (pc->cb_info == NULL) {
3848 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3849 return CAMERA_ERROR_INVALID_PARAMETER;
3851 sock_fd = pc->cb_info->fd;
3854 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3855 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3857 if (ret == CAMERA_ERROR_NONE) {
3858 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3859 *mode = (camera_attr_hdr_mode_e)get_mode;
3861 LOGD("ret : 0x%x", ret);
3866 bool camera_attr_is_supported_hdr_capture(camera_h camera)
3868 if( camera == NULL){
3869 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3873 int ret = CAMERA_ERROR_NONE;
3874 camera_cli_s *pc = (camera_cli_s *)camera;
3875 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
3877 if (pc->cb_info == NULL) {
3878 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3879 return CAMERA_ERROR_INVALID_PARAMETER;
3881 sock_fd = pc->cb_info->fd;
3882 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3883 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3884 LOGD("ret : 0x%x", ret);
3889 int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data)
3891 if (camera == NULL) {
3892 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3893 return CAMERA_ERROR_INVALID_PARAMETER;
3895 if (callback == NULL) {
3896 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - callback", CAMERA_ERROR_NOT_SUPPORTED);
3897 return CAMERA_ERROR_NOT_SUPPORTED;
3899 int ret = CAMERA_ERROR_NONE;
3901 camera_cli_s *pc = (camera_cli_s *)camera;
3902 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
3904 if (pc->cb_info == NULL) {
3905 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3906 return CAMERA_ERROR_INVALID_PARAMETER;
3908 sock_fd = pc->cb_info->fd;
3909 LOGD("Enter, handle :%x", pc->remote_handle);
3911 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = callback;
3912 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = user_data;
3914 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3915 LOGD("ret : 0x%x", ret);
3920 int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
3922 if( camera == NULL){
3923 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3924 return CAMERA_ERROR_INVALID_PARAMETER;
3927 int ret = CAMERA_ERROR_NONE;
3929 camera_cli_s *pc = (camera_cli_s *)camera;
3930 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
3932 if (pc->cb_info == NULL) {
3933 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3934 return CAMERA_ERROR_INVALID_PARAMETER;
3936 sock_fd = pc->cb_info->fd;
3937 LOGD("Enter, handle :%x", pc->remote_handle);
3939 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3940 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3942 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3943 LOGD("ret : 0x%x", ret);
3948 int camera_attr_enable_anti_shake(camera_h camera, bool enable)
3950 if (camera == NULL) {
3951 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3952 return CAMERA_ERROR_INVALID_PARAMETER;
3955 int ret = CAMERA_ERROR_NONE;
3956 camera_cli_s *pc = (camera_cli_s *)camera;
3957 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
3959 if (pc->cb_info == NULL) {
3960 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3961 return CAMERA_ERROR_INVALID_PARAMETER;
3963 sock_fd = pc->cb_info->fd;
3964 int set_enable = (int)enable;
3966 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3967 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3968 LOGD("ret : 0x%x", ret);
3973 int camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled)
3975 if (camera == NULL) {
3976 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3977 return CAMERA_ERROR_INVALID_PARAMETER;
3979 if (enabled == NULL) {
3980 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
3981 return CAMERA_ERROR_NOT_SUPPORTED;
3983 int ret = CAMERA_ERROR_NONE;
3984 camera_cli_s *pc = (camera_cli_s *)camera;
3985 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
3987 if (pc->cb_info == NULL) {
3988 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3989 return CAMERA_ERROR_INVALID_PARAMETER;
3991 sock_fd = pc->cb_info->fd;
3994 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3995 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3997 if (ret == CAMERA_ERROR_NONE) {
3998 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
3999 *enabled = (bool)get_enabled;
4001 LOGD("ret : 0x%x", ret);
4006 bool camera_attr_is_supported_anti_shake(camera_h camera)
4009 if( camera == NULL){
4010 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4014 int ret = CAMERA_ERROR_NONE;
4015 camera_cli_s *pc = (camera_cli_s *)camera;
4016 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
4018 if (pc->cb_info == NULL) {
4019 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4020 return CAMERA_ERROR_INVALID_PARAMETER;
4022 sock_fd = pc->cb_info->fd;
4023 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4024 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4025 LOGD("ret : 0x%x", ret);
4030 int camera_attr_enable_video_stabilization(camera_h camera, bool enable)
4032 if (camera == NULL) {
4033 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4034 return CAMERA_ERROR_INVALID_PARAMETER;
4037 int ret = CAMERA_ERROR_NONE;
4038 camera_cli_s *pc = (camera_cli_s *)camera;
4039 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
4041 if (pc->cb_info == NULL) {
4042 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4043 return CAMERA_ERROR_INVALID_PARAMETER;
4045 sock_fd = pc->cb_info->fd;
4046 int set_enable = (int)enable;
4048 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4049 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4050 LOGD("ret : 0x%x", ret);
4055 int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
4057 if (camera == NULL) {
4058 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
4059 return CAMERA_ERROR_INVALID_PARAMETER;
4061 if (enabled == NULL) {
4062 LOGE("INVALID_PARAMETER(0x%08x) - enabled",CAMERA_ERROR_INVALID_PARAMETER);
4063 return CAMERA_ERROR_NOT_SUPPORTED;
4065 int ret = CAMERA_ERROR_NONE;
4066 camera_cli_s *pc = (camera_cli_s *)camera;
4067 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
4069 if (pc->cb_info == NULL) {
4070 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4071 return CAMERA_ERROR_INVALID_PARAMETER;
4073 sock_fd = pc->cb_info->fd;
4076 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4077 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4079 if (ret == CAMERA_ERROR_NONE) {
4080 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4081 *enabled = (bool)get_enabled;
4083 LOGD("ret : 0x%x", ret);
4088 bool camera_attr_is_supported_video_stabilization(camera_h camera)
4090 if( camera == NULL){
4091 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4095 int ret = CAMERA_ERROR_NONE;
4096 camera_cli_s *pc = (camera_cli_s *)camera;
4097 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
4099 if (pc->cb_info == NULL) {
4100 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4101 return CAMERA_ERROR_INVALID_PARAMETER;
4103 sock_fd = pc->cb_info->fd;
4104 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4105 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4106 LOGD("ret : 0x%x", ret);
4111 int camera_attr_enable_auto_contrast(camera_h camera, bool enable)
4113 if( camera == NULL){
4114 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4115 return CAMERA_ERROR_INVALID_PARAMETER;
4118 int ret = CAMERA_ERROR_NONE;
4119 camera_cli_s *pc = (camera_cli_s *)camera;
4120 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
4122 if (pc->cb_info == NULL) {
4123 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4124 return CAMERA_ERROR_INVALID_PARAMETER;
4126 sock_fd = pc->cb_info->fd;
4127 int set_enable = (int)enable;
4129 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4130 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4131 LOGD("ret : 0x%x", ret);
4136 int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
4138 if (camera == NULL) {
4139 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4140 return CAMERA_ERROR_INVALID_PARAMETER;
4142 if (enabled == NULL) {
4143 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4144 return CAMERA_ERROR_INVALID_PARAMETER;
4146 int ret = CAMERA_ERROR_NONE;
4147 camera_cli_s *pc = (camera_cli_s *)camera;
4148 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
4150 if (pc->cb_info == NULL) {
4151 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4152 return CAMERA_ERROR_INVALID_PARAMETER;
4154 sock_fd = pc->cb_info->fd;
4157 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4158 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4160 if (ret == CAMERA_ERROR_NONE) {
4161 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4162 *enabled = (bool)get_enabled;
4164 LOGD("ret : 0x%x", ret);
4169 bool camera_attr_is_supported_auto_contrast(camera_h camera)
4171 if( camera == NULL){
4172 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4176 int ret = CAMERA_ERROR_NONE;
4177 camera_cli_s *pc = (camera_cli_s *)camera;
4178 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
4180 if (pc->cb_info == NULL) {
4181 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4182 return CAMERA_ERROR_INVALID_PARAMETER;
4184 sock_fd = pc->cb_info->fd;
4185 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4186 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4187 LOGD("ret : 0x%x", ret);
4192 int camera_attr_disable_shutter_sound(camera_h camera, bool disable)
4194 if (camera == NULL) {
4195 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4196 return CAMERA_ERROR_INVALID_PARAMETER;
4199 int ret = CAMERA_ERROR_NONE;
4200 camera_cli_s *pc = (camera_cli_s *)camera;
4201 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
4203 if (pc->cb_info == NULL) {
4204 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4205 return CAMERA_ERROR_INVALID_PARAMETER;
4207 sock_fd = pc->cb_info->fd;
4208 int set_disable = (int)disable;
4210 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4211 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_disable);
4212 LOGD("ret : 0x%x", ret);