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:
141 ((camera_preview_cb)cb_info->user_cb[event])(NULL,
142 cb_info->user_data[event]);
144 case MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW:
145 ((camera_media_packet_preview_cb)cb_info->user_cb[event])(NULL,
146 cb_info->user_data[event]);
148 case MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS:
151 muse_camera_msg_get(progress, recvMsg);
152 ((camera_attr_hdr_progress_cb)cb_info->user_cb[event])(progress,
153 cb_info->user_data[event]);
156 case MUSE_CAMERA_EVENT_TYPE_INTERRUPTED:
158 int cb_policy, cb_previous, cb_current;
159 muse_camera_msg_get(cb_policy, recvMsg);
160 muse_camera_msg_get(cb_previous, recvMsg);
161 muse_camera_msg_get(cb_current, recvMsg);
162 ((camera_interrupted_cb)cb_info->user_cb[event])((camera_policy_e)cb_policy,
163 (camera_state_e)cb_previous,
164 (camera_state_e)cb_current,
165 cb_info->user_data[event]);
168 case MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION:
171 muse_camera_msg_get(count, recvMsg);
172 ((camera_face_detected_cb)cb_info->user_cb[event])(NULL,
174 cb_info->user_data[event]);
177 case MUSE_CAMERA_EVENT_TYPE_ERROR:
179 int cb_error, cb_current_state;
180 muse_camera_msg_get(cb_error, recvMsg);
181 muse_camera_msg_get(cb_current_state, recvMsg);
182 ((camera_error_cb)cb_info->user_cb[event])((camera_error_e)cb_error,
183 (camera_state_e)cb_current_state,
184 cb_info->user_data[event]);
187 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
188 ((camera_supported_preview_resolution_cb)cb_info->user_cb[event])(param1, param2,
189 cb_info->user_data[event]);
191 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
192 ((camera_supported_capture_resolution_cb)cb_info->user_cb[event])(param1, param2,
193 cb_info->user_data[event]);
195 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
196 ((camera_supported_capture_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
197 cb_info->user_data[event]);
199 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
200 ((camera_supported_preview_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
201 cb_info->user_data[event]);
203 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
204 ((camera_attr_supported_af_mode_cb)cb_info->user_cb[event])((camera_attr_af_mode_e)param,
205 cb_info->user_data[event]);
207 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
208 ((camera_attr_supported_exposure_mode_cb)cb_info->user_cb[event])((camera_attr_exposure_mode_e)param,
209 cb_info->user_data[event]);
211 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
212 ((camera_attr_supported_iso_cb)cb_info->user_cb[event])((camera_attr_iso_e)param,
213 cb_info->user_data[event]);
215 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
216 ((camera_attr_supported_whitebalance_cb)cb_info->user_cb[event])((camera_attr_whitebalance_e)param,
217 cb_info->user_data[event]);
219 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
220 ((camera_attr_supported_effect_cb)cb_info->user_cb[event])((camera_attr_effect_mode_e)param,
221 cb_info->user_data[event]);
223 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
224 ((camera_attr_supported_scene_mode_cb)cb_info->user_cb[event])((camera_attr_scene_mode_e)param,
225 cb_info->user_data[event]);
227 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
228 ((camera_attr_supported_flash_mode_cb)cb_info->user_cb[event])((camera_attr_flash_mode_e)param,
229 cb_info->user_data[event]);
231 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
232 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
233 cb_info->user_data[event]);
235 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
236 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
237 cb_info->user_data[event]);
239 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
240 ((camera_attr_supported_stream_flip_cb)cb_info->user_cb[event])((camera_flip_e)param,
241 cb_info->user_data[event]);
243 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
244 ((camera_attr_supported_stream_rotation_cb)cb_info->user_cb[event])((camera_rotation_e)param,
245 cb_info->user_data[event]);
247 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
248 ((camera_attr_supported_theater_mode_cb)cb_info->user_cb[event])((camera_attr_theater_mode_e)param,
249 cb_info->user_data[event]);
251 case MUSE_CAMERA_EVENT_TYPE_CAPTURE:
253 int ret = CAMERA_ERROR_NONE;
254 camera_image_data_s *rImage = NULL;
255 camera_image_data_s *rPostview = NULL;
256 camera_image_data_s *rThumbnail = NULL;
257 unsigned char *buf_pos = NULL;
259 tbm_bo_handle bo_handle;
262 int is_thumbnail = 0;
264 muse_camera_msg_get(tbm_key, recvMsg);
265 muse_camera_msg_get(is_postview, recvMsg);
266 muse_camera_msg_get(is_thumbnail, recvMsg);
268 LOGD("camera capture callback came in. key %d, postview %d, thumbnail %d",
269 tbm_key, is_postview, is_thumbnail);
272 LOGE("invalid key %d", tbm_key);
276 /* import tbm bo and get virtual address */
277 bo = tbm_bo_import(cb_info->bufmgr, tbm_key);
279 LOGE("bo import failed - bufmgr %p, key %d", cb_info->bufmgr, tbm_key);
283 bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
284 if (bo_handle.ptr == NULL) {
285 LOGE("bo map failed %p", bo);
291 buf_pos = (unsigned char *)bo_handle.ptr;
292 rImage = (camera_image_data_s *)buf_pos;
293 rImage->data = buf_pos + sizeof(camera_image_data_s);
294 buf_pos += sizeof(camera_image_data_s) + rImage->size;
297 rPostview = (camera_image_data_s *)buf_pos;
298 LOGD("rPostview->size : %d", rPostview->size);
299 rPostview->data = buf_pos + sizeof(camera_image_data_s);
300 buf_pos += sizeof(camera_image_data_s) + rPostview->size;
304 rThumbnail = (camera_image_data_s *)buf_pos;
305 LOGD("rThumbnail->size : %d", rThumbnail->size);
306 rThumbnail->data = buf_pos + sizeof(camera_image_data_s);
307 buf_pos += sizeof(camera_image_data_s) + rThumbnail->size;
310 LOGD("read image info height: %d, width : %d, size : %d", rImage->height, rImage->width, rImage->size);
312 if (cb_info->user_cb[event]) {
313 ((camera_capturing_cb)cb_info->user_cb[event])(rImage, rPostview, rThumbnail, cb_info->user_data[event]);
315 LOGW("capture cb is NULL");
319 muse_camera_msg_send1(MUSE_CAMERA_API_RETURN_BUFFER, cb_info->fd, cb_info, ret, INT, tbm_key);
321 LOGD("return buffer result : 0x%x", ret);
323 /* unmap and unref tbm bo */
330 case MUSE_CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR:
334 LOGE("Unknonw event : %d", event);
339 static void *client_cb_handler(gpointer data)
347 callback_cb_info_s *cb_info = data;
348 char *recvMsg = cb_info->recvMsg;
349 char parseStr[CAMERA_PARSE_STRING_SIZE][MUSE_CAMERA_MSG_MAX_LENGTH] = {{0,0},};
351 while (g_atomic_int_get(&cb_info->running)) {
352 ret = muse_core_ipc_recv_msg(cb_info->fd, recvMsg);
360 memset(parseStr, 0, CAMERA_PARSE_STRING_SIZE * MUSE_CAMERA_MSG_MAX_LENGTH);
362 LOGD("recvMSg : %s, length : %d", recvMsg, ret);
364 /* Need to split the combined entering msgs.
365 This module supports up to 200 combined msgs. */
366 for (str_pos = 0; str_pos < ret; str_pos++) {
367 if(recvMsg[str_pos] == '}') {
368 strncpy(&(parseStr[num_token][0]), recvMsg + prev_pos, str_pos - prev_pos + 1);
369 LOGD("splitted msg : %s, Index : %d", &(parseStr[num_token][0]), num_token);
370 prev_pos = str_pos+1;
374 LOGD("num_token : %d", num_token);
376 /* Re-construct to the useful single msg. */
377 for (i = 0; i < num_token; i++) {
379 if (i >= CAMERA_PARSE_STRING_SIZE)
382 if (muse_camera_msg_get(api, &(parseStr[i][0]))) {
383 if(api < MUSE_CAMERA_API_MAX){
384 LOGD("Set Condition");
385 g_mutex_lock(&(cb_info->pMutex[api]));
387 /* The api msgs should be distinguished from the event msg. */
388 memset(cb_info->recvApiMsg, 0, strlen(cb_info->recvApiMsg));
389 strcpy(cb_info->recvApiMsg, &(parseStr[i][0]));
390 LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
391 cb_info->activating[api] = 1;
392 g_cond_signal(&(cb_info->pCond[api]));
393 g_mutex_unlock(&(cb_info->pMutex[api]));
395 if (api == MUSE_CAMERA_API_CREATE) {
396 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
397 if (ret != CAMERA_ERROR_NONE) {
398 g_atomic_int_set(&cb_info->running, 0);
399 LOGE("camera create error. close client cb handler");
402 LOGE("failed to get api return");
404 } else if (api == MUSE_CAMERA_API_DESTROY) {
405 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
406 if (ret == CAMERA_ERROR_NONE) {
407 g_atomic_int_set(&cb_info->running, 0);
408 LOGD("camera destroy done. close client cb handler");
411 LOGE("failed to get api return");
414 } else if(api == MUSE_CAMERA_CB_EVENT) {
416 if (muse_camera_msg_get(event, &(parseStr[i][0]))) {
417 LOGD("go callback : %d", event);
418 _client_user_callback(cb_info, event);
421 LOGW("unknown api : %d", api);
424 LOGE("Get Msg Failed");
429 LOGD("client cb exit");
434 static callback_cb_info_s *client_callback_new(gint sockfd)
436 callback_cb_info_s *cb_info;
438 GMutex *camera_mutex;
440 g_return_val_if_fail(sockfd > 0, NULL);
442 cb_info = g_new0(callback_cb_info_s, 1);
443 camera_cond = g_new0(GCond, MUSE_CAMERA_API_MAX);
444 camera_mutex = g_new0(GMutex, MUSE_CAMERA_API_MAX);
445 camera_activ = g_new0(gint, MUSE_CAMERA_API_MAX);
447 g_atomic_int_set(&cb_info->running, 1);
448 cb_info->fd = sockfd;
449 cb_info->pCond = camera_cond;
450 cb_info->pMutex = camera_mutex;
451 cb_info->activating = camera_activ;
453 g_thread_new("callback_thread", client_cb_handler,
459 static void client_callback_destroy(callback_cb_info_s * cb_info)
461 g_return_if_fail(cb_info != NULL);
463 LOGI("%p Callback destroyed", cb_info->thread);
465 g_thread_join(cb_info->thread);
466 g_thread_unref(cb_info->thread);
468 if (cb_info->bufmgr) {
469 tbm_bufmgr_deinit(cb_info->bufmgr);
470 cb_info->bufmgr = NULL;
473 if (cb_info->pCond) {
474 g_free(cb_info->pCond);
476 if (cb_info->pMutex) {
477 g_free(cb_info->pMutex);
479 if (cb_info->activating) {
480 g_free(cb_info->activating);
485 int camera_create(camera_device_e device, camera_h* camera)
489 int ret = CAMERA_ERROR_NONE;
490 camera_cli_s *pc = NULL;
491 tbm_bufmgr bufmgr = NULL;
493 muse_camera_api_e api = MUSE_CAMERA_API_CREATE;
494 muse_core_api_module_e muse_module = MUSE_CAMERA;
495 int device_type = (int)device;
498 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
499 return CAMERA_ERROR_INVALID_PARAMETER;
502 bufmgr = tbm_bufmgr_init(-1);
503 if (bufmgr == NULL) {
504 LOGE("get tbm bufmgr failed");
505 return CAMERA_ERROR_INVALID_OPERATION;
508 sock_fd = muse_core_client_new();
510 sndMsg = muse_core_msg_json_factory_new(api,
511 MUSE_TYPE_INT, "module", muse_module,
512 MUSE_TYPE_INT, PARAM_DEVICE_TYPE, (int)device_type,
515 muse_core_ipc_send_msg(sock_fd, sndMsg);
516 muse_core_msg_json_factory_free(sndMsg);
518 pc = g_new0(camera_cli_s, 1);
520 ret = CAMERA_ERROR_OUT_OF_MEMORY;
524 pc->cb_info = client_callback_new(sock_fd);
526 LOGD("cb info : %d", pc->cb_info->fd);
528 ret = client_wait_for_cb_return(api, pc->cb_info, CALLBACK_TIME_OUT);
529 if (ret == CAMERA_ERROR_NONE) {
531 muse_camera_msg_get_pointer(handle, pc->cb_info->recvMsg);
533 LOGE("Receiving Handle Failed!!");
534 ret = CAMERA_ERROR_INVALID_OPERATION;
537 pc->remote_handle = handle;
538 pc->cb_info->bufmgr = bufmgr;
541 LOGD("camera create 0x%x", pc->remote_handle);
543 *camera = (camera_h) pc;
551 tbm_bufmgr_deinit(bufmgr);
555 client_callback_destroy(pc->cb_info);
561 LOGE("camera create error : 0x%x", ret);
566 int camera_destroy(camera_h camera)
568 if (camera == NULL) {
569 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
570 return CAMERA_ERROR_INVALID_PARAMETER;
573 int ret = CAMERA_ERROR_NONE;
574 muse_camera_api_e api = MUSE_CAMERA_API_DESTROY;
575 camera_cli_s *pc = (camera_cli_s *)camera;
576 int sock_fd = pc->cb_info->fd;
580 LOGE("pc is already nul!!");
581 return CAMERA_ERROR_INVALID_PARAMETER;
582 } else if (pc->cb_info == NULL) {
583 return CAMERA_ERROR_INVALID_PARAMETER;
586 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
587 if (ret == CAMERA_ERROR_NONE) {
588 client_callback_destroy(pc->cb_info);
592 LOGE("camera destroy error : 0x%x", ret);
598 int camera_start_preview(camera_h camera)
601 if (camera == NULL) {
602 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
603 return CAMERA_ERROR_INVALID_PARAMETER;
606 int ret = CAMERA_ERROR_NONE;
607 muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
608 camera_cli_s *pc = (camera_cli_s *)camera;
610 char caps[MUSE_CAMERA_MSG_MAX_LENGTH] = {0};
612 if (pc->cb_info == NULL) {
613 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
614 return CAMERA_ERROR_INVALID_PARAMETER;
617 sock_fd = pc->cb_info->fd;
619 muse_camera_msg_send_longtime(api, sock_fd, pc->cb_info, ret);
620 LOGD("Enter, ret :0x%x", ret);
621 if(ret == CAMERA_ERROR_NONE) {
622 muse_camera_msg_get_string(caps, pc->cb_info->recvMsg);
623 LOGD("caps : %s", caps);
624 if (pc->cli_display_handle != 0) {
625 LOGD("client's display handle is : 0x%x", pc->cli_display_handle);
626 if(strlen(caps) > 0 &&
627 mm_camcorder_client_realize(pc->client_handle, caps) != MM_ERROR_NONE)
628 ret = CAMERA_ERROR_INVALID_OPERATION;
630 LOGD("display handle is NULL");
633 LOGD("ret : 0x%x", ret);
637 int camera_stop_preview(camera_h camera)
639 if (camera == NULL) {
640 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
641 return CAMERA_ERROR_INVALID_PARAMETER;
643 int ret = CAMERA_ERROR_NONE;
644 camera_cli_s *pc = (camera_cli_s *)camera;
646 muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
648 if (pc->cb_info == NULL) {
649 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
650 return CAMERA_ERROR_INVALID_PARAMETER;
653 sock_fd = pc->cb_info->fd;
655 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
657 if(ret == CAMERA_ERROR_NONE) {
658 if (pc->cli_display_handle != 0) {
659 LOGD("Unrealize client");
660 if (pc->client_handle != NULL) {
661 ret = mm_camcorder_client_unrealize(pc->client_handle);
662 mm_camcorder_client_destroy(pc->client_handle);
665 LOGD("Client did not realized : Display handle is NULL");
668 LOGD("ret : 0x%x", ret);
672 int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data)
674 if (camera == NULL) {
675 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
676 return CAMERA_ERROR_INVALID_PARAMETER;
678 int ret = CAMERA_ERROR_NONE;
680 camera_cli_s *pc = (camera_cli_s *)camera;
681 muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
683 int is_capturing_cb = 0;
684 int is_completed_cb = 0;
685 LOGD("Enter, handle :%x", pc->remote_handle);
687 if (pc->cb_info == NULL) {
688 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
689 return CAMERA_ERROR_INVALID_PARAMETER;
692 sock_fd = pc->cb_info->fd;
694 if (capturing_cb != NULL) {
696 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
697 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
700 if(completed_cb != NULL) {
702 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
703 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
706 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, is_capturing_cb, INT, is_completed_cb);
707 LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
708 LOGD("ret : 0x%x", ret);
712 bool camera_is_supported_continuous_capture(camera_h camera)
714 if (camera == NULL) {
715 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
719 int ret = CAMERA_ERROR_NONE;
720 camera_cli_s *pc = (camera_cli_s *)camera;
721 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
724 if (pc->cb_info == NULL) {
725 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
726 return CAMERA_ERROR_INVALID_PARAMETER;
729 sock_fd = pc->cb_info->fd;
731 LOGD("Enter, remote_handle : %x", pc->remote_handle);
732 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
733 LOGD("ret : 0x%x", ret);
737 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)
739 if (camera == NULL) {
740 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
741 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_CONTINUOUS_CAPTURE;
749 LOGD("Enter, handle :%x", pc->remote_handle);
752 if (pc->cb_info == NULL) {
753 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
754 return CAMERA_ERROR_INVALID_PARAMETER;
756 sock_fd = pc->cb_info->fd;
758 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
759 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
760 pc->cb_info->user_cb_completed[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = completed_cb;
762 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, count, INT, interval);
763 LOGD("ret : 0x%x", ret);
767 int camera_stop_continuous_capture(camera_h camera)
769 if (camera == NULL) {
770 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
771 return CAMERA_ERROR_INVALID_PARAMETER;
775 int ret = CAMERA_ERROR_NONE;
777 camera_cli_s *pc = (camera_cli_s *)camera;
778 muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
779 LOGD("Enter, handle :%x", pc->remote_handle);
781 if (pc->cb_info == NULL) {
782 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
783 return CAMERA_ERROR_INVALID_PARAMETER;
785 sock_fd = pc->cb_info->fd;
786 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
787 LOGD("ret : 0x%x", ret);
791 bool camera_is_supported_face_detection(camera_h camera)
793 if (camera == NULL) {
794 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
797 int ret = CAMERA_ERROR_NONE;
799 camera_cli_s *pc = (camera_cli_s *)camera;
800 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
802 if (pc->cb_info == NULL) {
803 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
804 return CAMERA_ERROR_INVALID_PARAMETER;
806 sock_fd = pc->cb_info->fd;
808 LOGD("Enter, remote_handle : %x", pc->remote_handle);
809 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
810 LOGD("ret : 0x%x", ret);
814 bool camera_is_supported_zero_shutter_lag(camera_h camera)
816 if (camera == NULL) {
817 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
820 int ret = CAMERA_ERROR_NONE;
822 camera_cli_s *pc = (camera_cli_s *)camera;
823 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
825 if (pc->cb_info == NULL) {
826 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
827 return CAMERA_ERROR_INVALID_PARAMETER;
829 sock_fd = pc->cb_info->fd;
831 LOGD("Enter, remote_handle : %x", pc->remote_handle);
832 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
833 LOGD("ret : 0x%x", ret);
837 bool camera_is_supported_media_packet_preview_cb(camera_h camera)
839 if (camera == NULL) {
840 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
844 int ret = CAMERA_ERROR_NONE;
846 camera_cli_s *pc = (camera_cli_s *)camera;
847 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
849 if (pc->cb_info == NULL) {
850 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
851 return CAMERA_ERROR_INVALID_PARAMETER;
853 sock_fd = pc->cb_info->fd;
855 LOGD("Enter, remote_handle : %x", pc->remote_handle);
856 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
857 LOGD("ret : 0x%x", ret);
861 int camera_get_device_count(camera_h camera, int *device_count)
863 if (camera == NULL || device_count == NULL) {
864 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
865 return CAMERA_ERROR_INVALID_PARAMETER;
867 int ret = CAMERA_ERROR_NONE;
869 camera_cli_s *pc = (camera_cli_s *)camera;
870 muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
872 if (pc->cb_info == NULL) {
873 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
874 return CAMERA_ERROR_INVALID_PARAMETER;
876 sock_fd = pc->cb_info->fd;
877 int get_device_count;
879 LOGD("Enter, remote_handle : %x", pc->remote_handle);
880 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
882 if (ret == CAMERA_ERROR_NONE) {
883 muse_camera_msg_get(get_device_count, pc->cb_info->recvMsg);
884 *device_count = get_device_count;
886 LOGD("ret : 0x%x", ret);
890 int camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data)
892 if (camera == NULL) {
893 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
894 return CAMERA_ERROR_INVALID_PARAMETER;
897 int ret = CAMERA_ERROR_NONE;
899 camera_cli_s *pc = (camera_cli_s *)camera;
900 muse_camera_api_e api = MUSE_CAMERA_API_START_FACE_DETECTION;
902 LOGD("Enter, handle :%x", pc->remote_handle);
904 if (pc->cb_info == NULL) {
905 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
906 return CAMERA_ERROR_INVALID_PARAMETER;
908 sock_fd = pc->cb_info->fd;
909 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = callback;
910 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = user_data;
912 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
913 LOGD("ret : 0x%x", ret);
917 int camera_stop_face_detection(camera_h camera)
919 if (camera == NULL) {
920 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
921 return CAMERA_ERROR_INVALID_PARAMETER;
924 int ret = CAMERA_ERROR_NONE;
926 camera_cli_s *pc = (camera_cli_s *)camera;
927 muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
928 LOGD("Enter, handle :%x", pc->remote_handle);
930 if (pc->cb_info == NULL) {
931 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
932 return CAMERA_ERROR_INVALID_PARAMETER;
934 sock_fd = pc->cb_info->fd;
935 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
936 LOGD("ret : 0x%x", ret);
940 int camera_get_state(camera_h camera, camera_state_e * state)
942 if (camera == NULL || state == NULL) {
943 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
944 return CAMERA_ERROR_INVALID_PARAMETER;
946 int ret = CAMERA_ERROR_NONE;
948 camera_cli_s *pc = (camera_cli_s *)camera;
949 muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
951 if (pc->cb_info == NULL) {
952 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
953 return CAMERA_ERROR_INVALID_PARAMETER;
955 sock_fd = pc->cb_info->fd;
958 LOGD("Enter, remote_handle : %x", pc->remote_handle);
959 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
961 if (ret == CAMERA_ERROR_NONE) {
962 muse_camera_msg_get(get_state, pc->cb_info->recvMsg);
963 *state = (camera_state_e)get_state;
965 LOGD("ret : 0x%x", ret);
969 int camera_start_focusing(camera_h camera, bool continuous)
972 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
973 return CAMERA_ERROR_INVALID_PARAMETER;
976 int ret = CAMERA_ERROR_NONE;
978 camera_cli_s *pc = (camera_cli_s *)camera;
979 muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
981 if (pc->cb_info == NULL) {
982 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
983 return CAMERA_ERROR_INVALID_PARAMETER;
985 sock_fd = pc->cb_info->fd;
986 int is_continuous = (int)continuous;
988 LOGD("Enter, remote_handle : %x", pc->remote_handle);
989 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, is_continuous);
990 LOGD("ret : 0x%x", ret);
994 int camera_cancel_focusing(camera_h camera)
996 if (camera == NULL) {
997 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
998 return CAMERA_ERROR_INVALID_PARAMETER;
1001 int ret = CAMERA_ERROR_NONE;
1003 camera_cli_s *pc = (camera_cli_s *)camera;
1004 muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
1006 if (pc->cb_info == NULL) {
1007 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1008 return CAMERA_ERROR_INVALID_PARAMETER;
1010 sock_fd = pc->cb_info->fd;
1012 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1013 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1014 LOGD("ret : 0x%x", ret);
1018 int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
1020 int ret = CAMERA_ERROR_NONE;
1021 int display_surface;
1022 void *set_display_handle = NULL;
1023 int set_surface = MM_DISPLAY_SURFACE_X;
1024 Evas_Object *obj = NULL;
1025 const char *object_type = NULL;
1026 char socket_path[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
1028 if (camera == NULL) {
1029 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1030 return CAMERA_ERROR_INVALID_PARAMETER;
1033 if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
1034 LOGE("display type[%d] is not NONE, but display handle is NULL", type);
1035 return CAMERA_ERROR_INVALID_PARAMETER;
1038 int display_type = (int)type;
1039 camera_cli_s *pc = (camera_cli_s *)camera;
1040 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
1042 if (pc->cb_info == NULL) {
1043 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1044 return CAMERA_ERROR_INVALID_PARAMETER;
1046 sock_fd = pc->cb_info->fd;
1048 LOGD("Enter, remote_handle : %x display : 0x%x", pc->remote_handle, display);
1050 if (type == CAMERA_DISPLAY_TYPE_NONE) {
1051 set_display_handle = 0;
1052 set_surface = MM_DISPLAY_SURFACE_NULL;
1053 LOGD("display type NONE");
1055 obj = (Evas_Object *)display;
1056 object_type = evas_object_type_get(obj);
1058 if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1060 MMCamWaylandInfo *wl_info = g_new0(MMCamWaylandInfo, 1);
1062 if (wl_info == NULL) {
1063 LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
1064 return CAMERA_ERROR_OUT_OF_MEMORY;
1067 wl_info->evas_obj = (void *)obj;
1068 wl_info->window = (void *)elm_win_wl_window_get(obj);
1069 wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
1070 wl_info->display = (void *)ecore_wl_display_get();
1072 if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
1073 LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
1074 return CAMERA_ERROR_INVALID_OPERATION;
1077 evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
1078 &wl_info->window_width, &wl_info->window_height);
1080 /* set wayland info */
1081 pc->wl_info = wl_info;
1082 set_surface = MM_DISPLAY_SURFACE_X;
1083 set_display_handle = (void *)wl_info;
1085 LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
1086 wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
1087 wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
1088 #else /* HAVE_WAYLAND */
1089 /* x window overlay surface */
1090 set_display_handle = (void *)elm_win_xwindow_get(obj);
1091 set_surface = MM_DISPLAY_SURFACE_X;
1092 LOGD("display type OVERLAY : handle %p", set_display_handle);
1094 } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
1095 /* evas object surface */
1096 set_display_handle = (void *)display;
1097 set_surface = MM_DISPLAY_SURFACE_EVAS;
1098 LOGD("display type EVAS : handle %p", set_display_handle);
1100 LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
1101 return CAMERA_ERROR_INVALID_PARAMETER;
1104 LOGE("failed to get evas object type from %p", obj);
1105 return CAMERA_ERROR_INVALID_PARAMETER;
1109 pc->cli_display_handle = (intptr_t)set_display_handle;
1110 display_surface = (int)set_surface;
1111 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret,
1113 INT, display_surface);
1115 if (ret == CAMERA_ERROR_NONE && type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1116 if (mm_camcorder_client_create(&(pc->client_handle))) {
1117 LOGE("camera client create Failed");
1118 return CAMERA_ERROR_INVALID_OPERATION;
1120 muse_camera_msg_get_string(socket_path, pc->cb_info->recvMsg);
1121 LOGD("shmsrc stream path : %s", socket_path);
1122 if(mm_camcorder_client_set_shm_socket_path(pc->client_handle, socket_path)
1124 return CAMERA_ERROR_INVALID_OPERATION;
1125 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1126 MMCAM_DISPLAY_SURFACE, set_surface,
1128 if (ret == MM_ERROR_NONE && type != CAMERA_DISPLAY_TYPE_NONE) {
1129 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1130 MMCAM_DISPLAY_HANDLE, pc->cli_display_handle, sizeof(void *),
1132 LOGD("ret : 0x%x", ret);
1135 LOGD("ret : 0x%x", ret);
1139 int camera_set_preview_resolution(camera_h camera, int width, int height)
1141 if( camera == NULL){
1142 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1143 return CAMERA_ERROR_INVALID_PARAMETER;
1145 int ret = CAMERA_ERROR_NONE;
1147 camera_cli_s *pc = (camera_cli_s *)camera;
1148 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
1150 if (pc->cb_info == NULL) {
1151 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1152 return CAMERA_ERROR_INVALID_PARAMETER;
1154 sock_fd = pc->cb_info->fd;
1156 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1157 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1158 LOGD("ret : 0x%x", ret);
1163 int camera_set_capture_resolution(camera_h camera, int width, int height)
1165 if (camera == NULL) {
1166 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1167 return CAMERA_ERROR_INVALID_PARAMETER;
1170 int ret = CAMERA_ERROR_NONE;
1172 camera_cli_s *pc = (camera_cli_s *)camera;
1173 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
1175 if (pc->cb_info == NULL) {
1176 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1177 return CAMERA_ERROR_INVALID_PARAMETER;
1179 sock_fd = pc->cb_info->fd;
1181 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1182 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1183 LOGD("ret : 0x%x", ret);
1187 int camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
1189 if (camera == NULL) {
1190 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1191 return CAMERA_ERROR_INVALID_PARAMETER;
1194 int ret = CAMERA_ERROR_NONE;
1195 int set_format = (int)format;
1197 camera_cli_s *pc = (camera_cli_s *)camera;
1198 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
1200 if (pc->cb_info == NULL) {
1201 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1202 return CAMERA_ERROR_INVALID_PARAMETER;
1204 sock_fd = pc->cb_info->fd;
1206 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1207 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1208 LOGD("ret : 0x%x", ret);
1212 int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
1214 if (camera == NULL) {
1215 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1216 return CAMERA_ERROR_INVALID_PARAMETER;
1219 int ret = CAMERA_ERROR_NONE;
1220 int set_format = (int)format;
1222 camera_cli_s *pc = (camera_cli_s *)camera;
1223 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
1225 if (pc->cb_info == NULL) {
1226 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1227 return CAMERA_ERROR_INVALID_PARAMETER;
1229 sock_fd = pc->cb_info->fd;
1231 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1232 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1233 LOGD("ret : 0x%x", ret);
1237 int camera_get_preview_resolution(camera_h camera, int *width, int *height)
1239 if (camera == NULL || width == NULL || height == NULL) {
1240 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1241 return CAMERA_ERROR_INVALID_PARAMETER;
1245 int ret = CAMERA_ERROR_NONE;
1247 camera_cli_s *pc = (camera_cli_s *)camera;
1248 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
1250 if (pc->cb_info == NULL) {
1251 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1252 return CAMERA_ERROR_INVALID_PARAMETER;
1254 sock_fd = pc->cb_info->fd;
1258 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1259 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1261 if (ret == CAMERA_ERROR_NONE) {
1262 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1263 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1265 *height = get_height;
1267 LOGD("ret : 0x%x", ret);
1271 int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
1273 if( camera == NULL){
1274 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1275 return CAMERA_ERROR_INVALID_PARAMETER;
1278 int ret = CAMERA_ERROR_NONE;
1279 camera_cli_s *pc = (camera_cli_s *)camera;
1280 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
1282 if (pc->cb_info == NULL) {
1283 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1284 return CAMERA_ERROR_INVALID_PARAMETER;
1286 sock_fd = pc->cb_info->fd;
1287 int set_rotation = (int)rotation;
1289 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1290 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
1291 LOGD("ret : 0x%x", ret);
1295 int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
1297 if( camera == NULL || rotation == NULL ){
1298 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1299 return CAMERA_ERROR_INVALID_PARAMETER;
1302 int ret = CAMERA_ERROR_NONE;
1304 camera_cli_s *pc = (camera_cli_s *)camera;
1305 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
1307 if (pc->cb_info == NULL) {
1308 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1309 return CAMERA_ERROR_INVALID_PARAMETER;
1311 sock_fd = pc->cb_info->fd;
1314 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1315 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1317 if (ret == CAMERA_ERROR_NONE) {
1318 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
1319 *rotation = (camera_rotation_e)get_rotation;
1321 LOGD("ret : 0x%x", ret);
1325 int camera_set_display_flip(camera_h camera, camera_flip_e flip)
1327 if( camera == NULL){
1328 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1329 return CAMERA_ERROR_INVALID_PARAMETER;
1332 int ret = CAMERA_ERROR_NONE;
1334 camera_cli_s *pc = (camera_cli_s *)camera;
1335 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
1337 if (pc->cb_info == NULL) {
1338 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1339 return CAMERA_ERROR_INVALID_PARAMETER;
1341 sock_fd = pc->cb_info->fd;
1342 int set_flip = (int)flip;
1344 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1345 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
1346 LOGD("ret : 0x%x", ret);
1350 int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
1352 if( camera == NULL || flip == NULL ){
1353 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1354 return CAMERA_ERROR_INVALID_PARAMETER;
1357 int ret = CAMERA_ERROR_NONE;
1359 camera_cli_s *pc = (camera_cli_s *)camera;
1360 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
1362 if (pc->cb_info == NULL) {
1363 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1364 return CAMERA_ERROR_INVALID_PARAMETER;
1366 sock_fd = pc->cb_info->fd;
1369 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1370 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1372 if (ret == CAMERA_ERROR_NONE) {
1373 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
1374 *flip = (camera_flip_e)get_flip;
1376 LOGD("ret : 0x%x", ret);
1380 int camera_set_display_visible(camera_h camera, bool visible)
1382 if( camera == NULL){
1383 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1384 return CAMERA_ERROR_INVALID_PARAMETER;
1387 int ret = CAMERA_ERROR_NONE;
1389 camera_cli_s *pc = (camera_cli_s *)camera;
1390 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
1391 int set_visible = (int)visible;
1393 if (pc->cb_info == NULL) {
1394 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1395 return CAMERA_ERROR_INVALID_PARAMETER;
1397 sock_fd = pc->cb_info->fd;
1399 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1400 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_visible);
1401 LOGD("ret : 0x%x", ret);
1405 int camera_is_display_visible(camera_h camera, bool* visible)
1407 if( camera == NULL || visible == NULL){
1408 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1409 return CAMERA_ERROR_INVALID_PARAMETER;
1412 int ret = CAMERA_ERROR_NONE;
1414 camera_cli_s *pc = (camera_cli_s *)camera;
1415 muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
1417 if (pc->cb_info == NULL) {
1418 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1419 return CAMERA_ERROR_INVALID_PARAMETER;
1421 sock_fd = pc->cb_info->fd;
1424 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1425 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1427 if (ret == CAMERA_ERROR_NONE) {
1428 muse_camera_msg_get(get_visible, pc->cb_info->recvMsg);
1429 *visible = (bool)get_visible;
1431 LOGD("ret : 0x%x", ret);
1435 int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
1437 if (camera == NULL) {
1438 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1439 return CAMERA_ERROR_INVALID_PARAMETER;
1442 int ret = CAMERA_ERROR_NONE;
1443 int set_mode = (int)mode;
1445 camera_cli_s *pc = (camera_cli_s *)camera;
1446 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
1448 if (pc->cb_info == NULL) {
1449 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1450 return CAMERA_ERROR_INVALID_PARAMETER;
1452 sock_fd = pc->cb_info->fd;
1454 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1455 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
1456 LOGD("ret : 0x%x", ret);
1460 int camera_get_display_mode(camera_h camera, camera_display_mode_e* mode)
1462 if( camera == NULL || mode == NULL){
1463 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1464 return CAMERA_ERROR_INVALID_PARAMETER;
1467 int ret = CAMERA_ERROR_NONE;
1469 camera_cli_s *pc = (camera_cli_s *)camera;
1470 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
1472 if (pc->cb_info == NULL) {
1473 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1474 return CAMERA_ERROR_INVALID_PARAMETER;
1476 sock_fd = pc->cb_info->fd;
1479 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1480 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1482 if (ret == CAMERA_ERROR_NONE) {
1483 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
1484 *mode = (camera_display_mode_e)get_mode;
1486 LOGD("ret : 0x%x", ret);
1490 int camera_get_capture_resolution(camera_h camera, int *width, int *height)
1492 if( camera == NULL || width== NULL || height == NULL){
1493 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1494 return CAMERA_ERROR_INVALID_PARAMETER;
1496 int ret = CAMERA_ERROR_NONE;
1498 camera_cli_s *pc = (camera_cli_s *)camera;
1499 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
1501 if (pc->cb_info == NULL) {
1502 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1503 return CAMERA_ERROR_INVALID_PARAMETER;
1505 sock_fd = pc->cb_info->fd;
1509 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1510 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1512 if (ret == CAMERA_ERROR_NONE) {
1513 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1514 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1516 *height = get_height;
1518 LOGD("ret : 0x%x", ret);
1522 int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
1524 if( camera == NULL || format == NULL){
1525 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1526 return CAMERA_ERROR_INVALID_PARAMETER;
1528 int ret = CAMERA_ERROR_NONE;
1530 camera_cli_s *pc = (camera_cli_s *)camera;
1531 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
1534 if (pc->cb_info == NULL) {
1535 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1536 return CAMERA_ERROR_INVALID_PARAMETER;
1538 sock_fd = pc->cb_info->fd;
1540 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1541 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1543 if (ret == CAMERA_ERROR_NONE) {
1544 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1545 *format = (camera_pixel_format_e)get_format;
1547 LOGD("ret : 0x%x", ret);
1551 int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
1553 if( camera == NULL || format == NULL){
1554 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1555 return CAMERA_ERROR_INVALID_PARAMETER;
1558 int ret = CAMERA_ERROR_NONE;
1560 camera_cli_s *pc = (camera_cli_s *)camera;
1561 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
1564 if (pc->cb_info == NULL) {
1565 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1566 return CAMERA_ERROR_INVALID_PARAMETER;
1568 sock_fd = pc->cb_info->fd;
1570 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1571 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1573 if (ret == CAMERA_ERROR_NONE) {
1574 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1575 *format = (camera_pixel_format_e)get_format;
1577 LOGD("ret : 0x%x", ret);
1581 int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void* user_data)
1583 if (camera == NULL || callback == NULL) {
1584 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1585 return CAMERA_ERROR_INVALID_PARAMETER;
1587 int ret = CAMERA_ERROR_NONE;
1589 camera_cli_s *pc = (camera_cli_s *)camera;
1591 if (pc->cb_info == NULL) {
1592 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1593 return CAMERA_ERROR_INVALID_PARAMETER;
1595 sock_fd = pc->cb_info->fd;
1596 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
1598 LOGD("Enter, handle :%x", pc->remote_handle);
1600 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = callback;
1601 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = user_data;
1603 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1604 LOGD("ret : 0x%x", ret);
1608 int camera_unset_preview_cb(camera_h camera)
1610 if (camera == NULL) {
1611 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1612 return CAMERA_ERROR_INVALID_PARAMETER;
1615 int ret = CAMERA_ERROR_NONE;
1617 camera_cli_s *pc = (camera_cli_s *)camera;
1618 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
1620 LOGD("Enter, handle :%x", pc->remote_handle);
1623 if (pc->cb_info == NULL) {
1624 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1625 return CAMERA_ERROR_INVALID_PARAMETER;
1627 sock_fd = pc->cb_info->fd;
1628 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1629 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1631 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1632 LOGD("ret : 0x%x", ret);
1636 int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void* user_data)
1638 if (camera == NULL) {
1639 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
1640 return CAMERA_ERROR_INVALID_PARAMETER;
1643 if (callback == NULL) {
1644 LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
1645 return CAMERA_ERROR_NOT_SUPPORTED;
1648 int ret = CAMERA_ERROR_NONE;
1650 camera_cli_s *pc = (camera_cli_s *)camera;
1651 muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
1653 LOGD("Enter, handle :%x", pc->remote_handle);
1656 if (pc->cb_info == NULL) {
1657 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1658 return CAMERA_ERROR_INVALID_PARAMETER;
1660 sock_fd = pc->cb_info->fd;
1661 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = callback;
1662 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = user_data;
1664 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1665 LOGD("ret : 0x%x", ret);
1669 int camera_unset_media_packet_preview_cb(camera_h camera)
1671 if (camera == NULL) {
1672 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1673 return CAMERA_ERROR_INVALID_PARAMETER;
1676 int ret = CAMERA_ERROR_NONE;
1678 camera_cli_s *pc = (camera_cli_s *)camera;
1679 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
1681 LOGD("Enter, handle :%x", pc->remote_handle);
1684 if (pc->cb_info == NULL) {
1685 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1686 return CAMERA_ERROR_INVALID_PARAMETER;
1688 sock_fd = pc->cb_info->fd;
1689 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1690 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1692 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1693 LOGD("ret : 0x%x", ret);
1697 int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void* user_data)
1699 if( camera == NULL || callback == NULL){
1700 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1701 return CAMERA_ERROR_INVALID_PARAMETER;
1703 int ret = CAMERA_ERROR_NONE;
1705 camera_cli_s *pc = (camera_cli_s *)camera;
1706 muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
1708 LOGD("Enter, handle :%x", pc->remote_handle);
1711 if (pc->cb_info == NULL) {
1712 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1713 return CAMERA_ERROR_INVALID_PARAMETER;
1715 sock_fd = pc->cb_info->fd;
1716 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = callback;
1717 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = user_data;
1719 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1720 LOGD("ret : 0x%x", ret);
1723 int camera_unset_state_changed_cb(camera_h camera)
1725 if( camera == NULL){
1726 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1727 return CAMERA_ERROR_INVALID_PARAMETER;
1729 int ret = CAMERA_ERROR_NONE;
1731 camera_cli_s *pc = (camera_cli_s *)camera;
1732 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
1734 LOGD("Enter, handle :%x", pc->remote_handle);
1737 if (pc->cb_info == NULL) {
1738 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1739 return CAMERA_ERROR_INVALID_PARAMETER;
1741 sock_fd = pc->cb_info->fd;
1742 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1743 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1745 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1746 LOGD("ret : 0x%x", ret);
1750 int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
1752 if( camera == NULL || callback == NULL){
1753 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1754 return CAMERA_ERROR_INVALID_PARAMETER;
1756 int ret = CAMERA_ERROR_NONE;
1758 camera_cli_s *pc = (camera_cli_s *)camera;
1759 muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
1761 LOGD("Enter, handle :%x", pc->remote_handle);
1764 if (pc->cb_info == NULL) {
1765 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1766 return CAMERA_ERROR_INVALID_PARAMETER;
1768 sock_fd = pc->cb_info->fd;
1769 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = callback;
1770 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = user_data;
1772 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1773 LOGD("ret : 0x%x", ret);
1777 int camera_unset_interrupted_cb(camera_h camera)
1779 if( camera == NULL){
1780 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1781 return CAMERA_ERROR_INVALID_PARAMETER;
1783 int ret = CAMERA_ERROR_NONE;
1785 camera_cli_s *pc = (camera_cli_s *)camera;
1786 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
1788 LOGD("Enter, handle :%x", pc->remote_handle);
1791 if (pc->cb_info == NULL) {
1792 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1793 return CAMERA_ERROR_INVALID_PARAMETER;
1795 sock_fd = pc->cb_info->fd;
1796 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1797 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1799 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1800 LOGD("ret : 0x%x", ret);
1804 int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void* user_data)
1806 if( camera == NULL || callback == NULL){
1807 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1808 return CAMERA_ERROR_INVALID_PARAMETER;
1810 int ret = CAMERA_ERROR_NONE;
1812 camera_cli_s *pc = (camera_cli_s *)camera;
1813 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
1815 LOGD("Enter, handle :%x", pc->remote_handle);
1818 if (pc->cb_info == NULL) {
1819 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1820 return CAMERA_ERROR_INVALID_PARAMETER;
1822 sock_fd = pc->cb_info->fd;
1823 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = callback;
1824 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = user_data;
1826 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1827 LOGD("ret : 0x%x", ret);
1831 int camera_unset_focus_changed_cb(camera_h camera)
1833 if( camera == NULL){
1834 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1835 return CAMERA_ERROR_INVALID_PARAMETER;
1837 int ret = CAMERA_ERROR_NONE;
1839 camera_cli_s *pc = (camera_cli_s *)camera;
1840 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
1842 LOGD("Enter, handle :%x", pc->remote_handle);
1845 if (pc->cb_info == NULL) {
1846 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1847 return CAMERA_ERROR_INVALID_PARAMETER;
1849 sock_fd = pc->cb_info->fd;
1850 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1851 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1853 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1854 LOGD("ret : 0x%x", ret);
1858 int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
1860 if( camera == NULL || callback == NULL){
1861 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1862 return CAMERA_ERROR_INVALID_PARAMETER;
1864 int ret = CAMERA_ERROR_NONE;
1866 camera_cli_s *pc = (camera_cli_s *)camera;
1867 muse_camera_api_e api = MUSE_CAMERA_API_SET_ERROR_CB;
1869 LOGD("Enter, handle :%x", pc->remote_handle);
1872 if (pc->cb_info == NULL) {
1873 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1874 return CAMERA_ERROR_INVALID_PARAMETER;
1876 sock_fd = pc->cb_info->fd;
1877 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = callback;
1878 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = user_data;
1880 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1881 LOGD("ret : 0x%x", ret);
1885 int camera_unset_error_cb(camera_h camera)
1887 if( camera == NULL){
1888 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1889 return CAMERA_ERROR_INVALID_PARAMETER;
1891 int ret = CAMERA_ERROR_NONE;
1893 camera_cli_s *pc = (camera_cli_s *)camera;
1894 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
1896 LOGD("Enter, handle :%x", pc->remote_handle);
1899 if (pc->cb_info == NULL) {
1900 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1901 return CAMERA_ERROR_INVALID_PARAMETER;
1903 sock_fd = pc->cb_info->fd;
1904 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1905 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1907 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1908 LOGD("ret : 0x%x", ret);
1912 int camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb , void *user_data)
1914 if( camera == NULL || foreach_cb == NULL){
1915 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1916 return CAMERA_ERROR_INVALID_PARAMETER;
1918 int ret = CAMERA_ERROR_NONE;
1920 camera_cli_s *pc = (camera_cli_s *)camera;
1921 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
1923 LOGD("Enter, handle :%x", pc->remote_handle);
1926 if (pc->cb_info == NULL) {
1927 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1928 return CAMERA_ERROR_INVALID_PARAMETER;
1930 sock_fd = pc->cb_info->fd;
1931 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
1932 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
1934 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1935 LOGD("ret : 0x%x", ret);
1939 int camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb , void *user_data)
1941 if( camera == NULL || foreach_cb == NULL){
1942 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1943 return CAMERA_ERROR_INVALID_PARAMETER;
1945 int ret = CAMERA_ERROR_NONE;
1947 camera_cli_s *pc = (camera_cli_s *)camera;
1948 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
1950 LOGD("Enter, handle :%x", pc->remote_handle);
1953 if (pc->cb_info == NULL) {
1954 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1955 return CAMERA_ERROR_INVALID_PARAMETER;
1957 sock_fd = pc->cb_info->fd;
1958 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
1959 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
1961 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1962 LOGD("ret : 0x%x", ret);
1966 int camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb , void *user_data)
1968 if( camera == NULL || foreach_cb == NULL){
1969 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1970 return CAMERA_ERROR_INVALID_PARAMETER;
1972 int ret = CAMERA_ERROR_NONE;
1974 camera_cli_s *pc = (camera_cli_s *)camera;
1975 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
1977 LOGD("Enter, handle :%x", pc->remote_handle);
1980 if (pc->cb_info == NULL) {
1981 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1982 return CAMERA_ERROR_INVALID_PARAMETER;
1984 sock_fd = pc->cb_info->fd;
1985 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
1986 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
1988 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1989 LOGD("ret : 0x%x", ret);
1994 int camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb , void *user_data)
1996 if( camera == NULL || foreach_cb == NULL){
1997 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1998 return CAMERA_ERROR_INVALID_PARAMETER;
2000 int ret = CAMERA_ERROR_NONE;
2002 camera_cli_s *pc = (camera_cli_s *)camera;
2003 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
2005 LOGD("Enter, handle :%x", pc->remote_handle);
2008 if (pc->cb_info == NULL) {
2009 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2010 return CAMERA_ERROR_INVALID_PARAMETER;
2012 sock_fd = pc->cb_info->fd;
2013 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
2014 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
2016 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2017 LOGD("ret : 0x%x", ret);
2022 int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
2024 if (camera == NULL || width == NULL || height == NULL) {
2025 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2026 return CAMERA_ERROR_INVALID_PARAMETER;
2028 int ret = CAMERA_ERROR_NONE;
2030 camera_cli_s *pc = (camera_cli_s *)camera;
2031 muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
2033 if (pc->cb_info == NULL) {
2034 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2035 return CAMERA_ERROR_INVALID_PARAMETER;
2037 sock_fd = pc->cb_info->fd;
2041 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2042 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2044 if (ret == CAMERA_ERROR_NONE) {
2045 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2046 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2048 *height = get_height;
2050 LOGD("ret : 0x%x", ret);
2055 int camera_attr_get_lens_orientation(camera_h camera, int *angle)
2057 if( camera == NULL || angle == NULL){
2058 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2059 return CAMERA_ERROR_INVALID_PARAMETER;
2061 int ret = CAMERA_ERROR_NONE;
2063 camera_cli_s *pc = (camera_cli_s *)camera;
2064 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
2066 if (pc->cb_info == NULL) {
2067 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2068 return CAMERA_ERROR_INVALID_PARAMETER;
2070 sock_fd = pc->cb_info->fd;
2073 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2074 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2076 if (ret == CAMERA_ERROR_NONE) {
2077 muse_camera_msg_get(get_angle, pc->cb_info->recvMsg);
2080 LOGD("ret : 0x%x", ret);
2084 int camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
2086 if (camera == NULL) {
2087 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2088 return CAMERA_ERROR_INVALID_PARAMETER;
2090 int ret = CAMERA_ERROR_NONE;
2091 camera_cli_s *pc = (camera_cli_s *)camera;
2092 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
2094 if (pc->cb_info == NULL) {
2095 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2096 return CAMERA_ERROR_INVALID_PARAMETER;
2098 sock_fd = pc->cb_info->fd;
2099 int set_mode = (int)mode;
2100 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2101 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2102 LOGD("ret : 0x%x", ret);
2106 int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
2108 if (camera == NULL || mode == NULL) {
2109 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2110 return CAMERA_ERROR_INVALID_PARAMETER;
2113 int ret = CAMERA_ERROR_NONE;
2114 camera_cli_s *pc = (camera_cli_s *)camera;
2115 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
2117 if (pc->cb_info == NULL) {
2118 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2119 return CAMERA_ERROR_INVALID_PARAMETER;
2121 sock_fd = pc->cb_info->fd;
2123 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2124 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2126 if (ret == CAMERA_ERROR_NONE) {
2127 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2128 *mode = (camera_attr_theater_mode_e)get_mode;
2130 LOGD("ret : 0x%x", ret);
2134 int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
2136 if (camera == NULL || foreach_cb == NULL) {
2137 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2138 return CAMERA_ERROR_INVALID_PARAMETER;
2140 int ret = CAMERA_ERROR_NONE;
2142 camera_cli_s *pc = (camera_cli_s *)camera;
2143 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE;
2145 LOGD("Enter, handle :%x", pc->remote_handle);
2148 if (pc->cb_info == NULL) {
2149 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2150 return CAMERA_ERROR_INVALID_PARAMETER;
2152 sock_fd = pc->cb_info->fd;
2153 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
2154 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
2156 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2158 LOGD("Finish, return :%x", ret);
2163 int camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
2165 if( camera == NULL){
2166 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2167 return CAMERA_ERROR_INVALID_PARAMETER;
2169 int ret = CAMERA_ERROR_NONE;
2170 camera_cli_s *pc = (camera_cli_s *)camera;
2171 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
2173 if (pc->cb_info == NULL) {
2174 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2175 return CAMERA_ERROR_INVALID_PARAMETER;
2177 sock_fd = pc->cb_info->fd;
2178 int set_fps = (int)fps;
2179 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2180 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_fps);
2181 LOGD("ret : 0x%x", ret);
2186 int camera_attr_set_image_quality(camera_h camera, int quality)
2188 if( camera == NULL){
2189 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2190 return CAMERA_ERROR_INVALID_PARAMETER;
2192 int ret = CAMERA_ERROR_NONE;
2194 camera_cli_s *pc = (camera_cli_s *)camera;
2195 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
2197 if (pc->cb_info == NULL) {
2198 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2199 return CAMERA_ERROR_INVALID_PARAMETER;
2201 sock_fd = pc->cb_info->fd;
2202 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2203 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, quality);
2204 LOGD("ret : 0x%x", ret);
2208 int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
2210 if( camera == NULL || fps == NULL){
2211 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2212 return CAMERA_ERROR_INVALID_PARAMETER;
2214 int ret = CAMERA_ERROR_NONE;
2216 camera_cli_s *pc = (camera_cli_s *)camera;
2217 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
2220 if (pc->cb_info == NULL) {
2221 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2222 return CAMERA_ERROR_INVALID_PARAMETER;
2224 sock_fd = pc->cb_info->fd;
2226 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2227 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2229 if (ret == CAMERA_ERROR_NONE) {
2230 muse_camera_msg_get(get_fps, pc->cb_info->recvMsg);
2231 *fps = (camera_attr_fps_e)get_fps;
2233 LOGD("ret : 0x%x", ret);
2238 int camera_attr_get_image_quality(camera_h camera, int *quality)
2240 if( camera == NULL || quality == NULL){
2241 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2242 return CAMERA_ERROR_INVALID_PARAMETER;
2244 int ret = CAMERA_ERROR_NONE;
2246 camera_cli_s *pc = (camera_cli_s *)camera;
2247 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
2249 if (pc->cb_info == NULL) {
2250 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2251 return CAMERA_ERROR_INVALID_PARAMETER;
2253 sock_fd = pc->cb_info->fd;
2255 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2256 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2258 if (ret == CAMERA_ERROR_NONE) {
2259 muse_camera_msg_get(get_quality, pc->cb_info->recvMsg);
2260 *quality = get_quality;
2262 LOGD("ret : 0x%x", ret);
2267 int camera_attr_set_zoom(camera_h camera, int zoom)
2269 if( camera == NULL){
2270 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2271 return CAMERA_ERROR_INVALID_PARAMETER;
2273 int ret = CAMERA_ERROR_NONE;
2275 camera_cli_s *pc = (camera_cli_s *)camera;
2276 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
2278 if (pc->cb_info == NULL) {
2279 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2280 return CAMERA_ERROR_INVALID_PARAMETER;
2282 sock_fd = pc->cb_info->fd;
2284 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2285 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, zoom);
2286 LOGD("ret : 0x%x", ret);
2290 int camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
2292 if( camera == NULL){
2293 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2294 return CAMERA_ERROR_INVALID_PARAMETER;
2296 int ret = CAMERA_ERROR_NONE;
2298 camera_cli_s *pc = (camera_cli_s *)camera;
2299 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
2301 if (pc->cb_info == NULL) {
2302 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2303 return CAMERA_ERROR_INVALID_PARAMETER;
2305 sock_fd = pc->cb_info->fd;
2306 int set_mode = (int)mode;
2307 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2308 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2309 LOGD("ret : 0x%x", ret);
2313 int camera_attr_set_af_area(camera_h camera, int x, int y)
2315 if( camera == NULL){
2316 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2317 return CAMERA_ERROR_INVALID_PARAMETER;
2319 int ret = CAMERA_ERROR_NONE;
2320 camera_cli_s *pc = (camera_cli_s *)camera;
2321 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
2322 int sock_fd = pc->cb_info->fd;
2323 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2324 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, x, INT, y);
2325 LOGD("ret : 0x%x", ret);
2330 int camera_attr_clear_af_area(camera_h camera)
2332 if( camera == NULL){
2333 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2334 return CAMERA_ERROR_INVALID_PARAMETER;
2336 int ret = CAMERA_ERROR_NONE;
2338 camera_cli_s *pc = (camera_cli_s *)camera;
2339 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA;
2341 if (pc->cb_info == NULL) {
2342 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2343 return CAMERA_ERROR_INVALID_PARAMETER;
2345 sock_fd = pc->cb_info->fd;
2346 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2347 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2348 LOGD("ret : 0x%x", ret);
2353 int camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode)
2355 if( camera == NULL){
2356 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2357 return CAMERA_ERROR_INVALID_PARAMETER;
2360 if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
2361 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
2362 return CAMERA_ERROR_NOT_SUPPORTED;
2365 int ret = CAMERA_ERROR_NONE;
2366 camera_cli_s *pc = (camera_cli_s *)camera;
2367 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
2368 int set_mode = (int)mode;
2370 if (pc->cb_info == NULL) {
2371 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2372 return CAMERA_ERROR_INVALID_PARAMETER;
2374 sock_fd = pc->cb_info->fd;
2375 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2376 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2377 LOGD("ret : 0x%x", ret);
2382 int camera_attr_set_exposure(camera_h camera, int value)
2384 if( camera == NULL){
2385 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2386 return CAMERA_ERROR_INVALID_PARAMETER;
2388 int ret = CAMERA_ERROR_NONE;
2390 camera_cli_s *pc = (camera_cli_s *)camera;
2391 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
2393 if (pc->cb_info == NULL) {
2394 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2395 return CAMERA_ERROR_INVALID_PARAMETER;
2397 sock_fd = pc->cb_info->fd;
2399 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2400 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, value);
2401 LOGD("ret : 0x%x", ret);
2406 int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
2408 if( camera == NULL){
2409 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2410 return CAMERA_ERROR_INVALID_PARAMETER;
2412 int ret = CAMERA_ERROR_NONE;
2414 camera_cli_s *pc = (camera_cli_s *)camera;
2415 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
2417 if (pc->cb_info == NULL) {
2418 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2419 return CAMERA_ERROR_INVALID_PARAMETER;
2421 sock_fd = pc->cb_info->fd;
2422 int set_iso = (int)iso;
2423 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2424 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_iso);
2425 LOGD("ret : 0x%x", ret);
2430 int camera_attr_set_brightness(camera_h camera, int level)
2432 if( camera == NULL){
2433 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2434 return CAMERA_ERROR_INVALID_PARAMETER;
2436 int ret = CAMERA_ERROR_NONE;
2438 camera_cli_s *pc = (camera_cli_s *)camera;
2439 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
2441 if (pc->cb_info == NULL) {
2442 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2443 return CAMERA_ERROR_INVALID_PARAMETER;
2445 sock_fd = pc->cb_info->fd;
2447 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2448 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2449 LOGD("ret : 0x%x", ret);
2454 int camera_attr_set_contrast(camera_h camera, int level)
2456 if( camera == NULL){
2457 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2458 return CAMERA_ERROR_INVALID_PARAMETER;
2460 int ret = CAMERA_ERROR_NONE;
2462 camera_cli_s *pc = (camera_cli_s *)camera;
2463 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_CONTRAST;
2465 if (pc->cb_info == NULL) {
2466 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2467 return CAMERA_ERROR_INVALID_PARAMETER;
2469 sock_fd = pc->cb_info->fd;
2471 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2472 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2473 LOGD("ret : 0x%x", ret);
2478 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
2480 if (camera == NULL) {
2481 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2482 return CAMERA_ERROR_INVALID_PARAMETER;
2485 if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
2486 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_NOT_SUPPORTED);
2487 return CAMERA_ERROR_NOT_SUPPORTED;
2490 int ret = CAMERA_ERROR_NONE;
2492 camera_cli_s *pc = (camera_cli_s *)camera;
2493 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
2495 if (pc->cb_info == NULL) {
2496 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2497 return CAMERA_ERROR_INVALID_PARAMETER;
2499 sock_fd = pc->cb_info->fd;
2500 int set_whitebalance = (int)wb;
2501 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2502 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_whitebalance);
2503 LOGD("ret : 0x%x", ret);
2508 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
2510 if( camera == NULL){
2511 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2512 return CAMERA_ERROR_INVALID_PARAMETER;
2514 int ret = CAMERA_ERROR_NONE;
2516 camera_cli_s *pc = (camera_cli_s *)camera;
2517 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
2519 if (pc->cb_info == NULL) {
2520 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2521 return CAMERA_ERROR_INVALID_PARAMETER;
2523 sock_fd = pc->cb_info->fd;
2524 int set_effect = (int)effect;
2525 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2526 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_effect);
2527 LOGD("ret : 0x%x", ret);
2532 int camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
2534 if( camera == NULL){
2535 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2536 return CAMERA_ERROR_INVALID_PARAMETER;
2538 int ret = CAMERA_ERROR_NONE;
2540 camera_cli_s *pc = (camera_cli_s *)camera;
2541 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
2543 if (pc->cb_info == NULL) {
2544 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2545 return CAMERA_ERROR_INVALID_PARAMETER;
2547 sock_fd = pc->cb_info->fd;
2548 int set_mode = (int)mode;
2549 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2550 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2551 LOGD("ret : 0x%x", ret);
2556 int camera_attr_enable_tag(camera_h camera, bool enable)
2558 if( camera == NULL){
2559 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2560 return CAMERA_ERROR_INVALID_PARAMETER;
2562 int ret = CAMERA_ERROR_NONE;
2563 camera_cli_s *pc = (camera_cli_s *)camera;
2564 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
2566 if (pc->cb_info == NULL) {
2567 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2568 return CAMERA_ERROR_INVALID_PARAMETER;
2570 sock_fd = pc->cb_info->fd;
2571 int set_enable = (int)enable;
2573 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2574 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
2575 LOGD("ret : 0x%x", ret);
2580 int camera_attr_set_tag_image_description(camera_h camera, const char *description)
2582 if( camera == NULL){
2583 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2584 return CAMERA_ERROR_INVALID_PARAMETER;
2586 if( description == NULL){
2587 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2588 return CAMERA_ERROR_INVALID_PARAMETER;
2590 int ret = CAMERA_ERROR_NONE;
2591 camera_cli_s *pc = (camera_cli_s *)camera;
2592 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
2594 if (pc->cb_info == NULL) {
2595 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2596 return CAMERA_ERROR_INVALID_PARAMETER;
2598 sock_fd = pc->cb_info->fd;
2599 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2600 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, description);
2601 LOGD("ret : 0x%x", ret);
2606 int camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation)
2608 if( camera == NULL){
2609 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2610 return CAMERA_ERROR_INVALID_PARAMETER;
2612 int ret = CAMERA_ERROR_NONE;
2613 camera_cli_s *pc = (camera_cli_s *)camera;
2614 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
2616 if (pc->cb_info == NULL) {
2617 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2618 return CAMERA_ERROR_INVALID_PARAMETER;
2620 sock_fd = pc->cb_info->fd;
2621 int set_orientation = (int)orientation;
2623 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2624 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_orientation);
2625 LOGD("ret : 0x%x", ret);
2630 int camera_attr_set_tag_software(camera_h camera, const char *software)
2632 if( camera == NULL){
2633 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2634 return CAMERA_ERROR_INVALID_PARAMETER;
2636 if( software == NULL){
2637 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2638 return CAMERA_ERROR_INVALID_PARAMETER;
2640 int ret = CAMERA_ERROR_NONE;
2641 camera_cli_s *pc = (camera_cli_s *)camera;
2642 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
2644 if (pc->cb_info == NULL) {
2645 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2646 return CAMERA_ERROR_INVALID_PARAMETER;
2648 sock_fd = pc->cb_info->fd;
2649 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2650 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, software);
2651 LOGD("ret : 0x%x", ret);
2656 int camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
2658 if( camera == NULL){
2659 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2660 return CAMERA_ERROR_INVALID_PARAMETER;
2662 int ret = CAMERA_ERROR_NONE;
2663 camera_cli_s *pc = (camera_cli_s *)camera;
2664 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
2666 if (pc->cb_info == NULL) {
2667 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2668 return CAMERA_ERROR_INVALID_PARAMETER;
2670 sock_fd = pc->cb_info->fd;
2671 double set_geotag[3] = { latitude, longitude, altitude };
2673 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2674 muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
2675 set_geotag, sizeof(set_geotag), sizeof(double));
2676 LOGD("ret : 0x%x", ret);
2681 int camera_attr_remove_geotag(camera_h camera)
2683 if( camera == NULL){
2684 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2685 return CAMERA_ERROR_INVALID_PARAMETER;
2687 int ret = CAMERA_ERROR_NONE;
2688 camera_cli_s *pc = (camera_cli_s *)camera;
2689 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
2691 if (pc->cb_info == NULL) {
2692 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2693 return CAMERA_ERROR_INVALID_PARAMETER;
2695 sock_fd = pc->cb_info->fd;
2696 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2697 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2698 LOGD("ret : 0x%x", ret);
2703 int camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
2705 if( camera == NULL){
2706 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2707 return CAMERA_ERROR_INVALID_PARAMETER;
2709 int ret = CAMERA_ERROR_NONE;
2710 camera_cli_s *pc = (camera_cli_s *)camera;
2711 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
2713 if (pc->cb_info == NULL) {
2714 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2715 return CAMERA_ERROR_INVALID_PARAMETER;
2717 sock_fd = pc->cb_info->fd;
2718 int set_mode = (int)mode;
2720 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2721 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2722 LOGD("ret : 0x%x", ret);
2727 int camera_attr_get_zoom(camera_h camera, int *zoom)
2729 if( camera == NULL || zoom == NULL){
2730 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2731 return CAMERA_ERROR_INVALID_PARAMETER;
2733 int ret = CAMERA_ERROR_NONE;
2735 camera_cli_s *pc = (camera_cli_s *)camera;
2736 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
2739 if (pc->cb_info == NULL) {
2740 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2741 return CAMERA_ERROR_INVALID_PARAMETER;
2743 sock_fd = pc->cb_info->fd;
2745 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2746 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2748 if (ret == CAMERA_ERROR_NONE) {
2749 muse_camera_msg_get(get_zoom, pc->cb_info->recvMsg);
2752 LOGD("ret : 0x%x", ret);
2757 int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
2759 if( camera == NULL || min == NULL || max == NULL ){
2760 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2761 return CAMERA_ERROR_INVALID_PARAMETER;
2763 int ret = CAMERA_ERROR_NONE;
2764 camera_cli_s *pc = (camera_cli_s *)camera;
2766 if (pc->cb_info == NULL) {
2767 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2768 return CAMERA_ERROR_INVALID_PARAMETER;
2770 sock_fd = pc->cb_info->fd;
2771 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
2775 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2776 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2778 if (ret == CAMERA_ERROR_NONE) {
2779 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2780 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2784 LOGD("ret : 0x%x", ret);
2789 int camera_attr_get_af_mode( camera_h camera, camera_attr_af_mode_e *mode)
2791 if( camera == NULL || mode == NULL){
2792 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2793 return CAMERA_ERROR_INVALID_PARAMETER;
2795 int ret = CAMERA_ERROR_NONE;
2796 camera_cli_s *pc = (camera_cli_s *)camera;
2798 if (pc->cb_info == NULL) {
2799 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2800 return CAMERA_ERROR_INVALID_PARAMETER;
2802 sock_fd = pc->cb_info->fd;
2803 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
2806 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2807 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2809 if (ret == CAMERA_ERROR_NONE) {
2810 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2811 *mode = (camera_attr_af_mode_e)get_mode;
2813 LOGD("ret : 0x%x", ret);
2818 int camera_attr_get_exposure_mode( camera_h camera, camera_attr_exposure_mode_e *mode)
2820 if( camera == NULL|| mode == NULL){
2821 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2822 return CAMERA_ERROR_INVALID_PARAMETER;
2824 int ret = CAMERA_ERROR_NONE;
2825 camera_cli_s *pc = (camera_cli_s *)camera;
2827 if (pc->cb_info == NULL) {
2828 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2829 return CAMERA_ERROR_INVALID_PARAMETER;
2831 sock_fd = pc->cb_info->fd;
2832 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
2835 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2836 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2838 if (ret == CAMERA_ERROR_NONE) {
2839 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2840 *mode = (camera_attr_exposure_mode_e)get_mode;
2842 LOGD("ret : 0x%x", ret);
2846 int camera_attr_get_exposure(camera_h camera, int *value)
2848 if( camera == NULL || value == NULL){
2849 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2850 return CAMERA_ERROR_INVALID_PARAMETER;
2852 int ret = CAMERA_ERROR_NONE;
2853 camera_cli_s *pc = (camera_cli_s *)camera;
2855 if (pc->cb_info == NULL) {
2856 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2857 return CAMERA_ERROR_INVALID_PARAMETER;
2859 sock_fd = pc->cb_info->fd;
2860 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
2863 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2864 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2866 if (ret == CAMERA_ERROR_NONE) {
2867 muse_camera_msg_get(get_value, pc->cb_info->recvMsg);
2870 LOGD("ret : 0x%x", ret);
2875 int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
2877 if( camera == NULL || min == NULL || max == NULL ){
2878 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2879 return CAMERA_ERROR_INVALID_PARAMETER;
2881 int ret = CAMERA_ERROR_NONE;
2882 camera_cli_s *pc = (camera_cli_s *)camera;
2884 if (pc->cb_info == NULL) {
2885 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2886 return CAMERA_ERROR_INVALID_PARAMETER;
2888 sock_fd = pc->cb_info->fd;
2889 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
2893 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2894 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2896 if (ret == CAMERA_ERROR_NONE) {
2897 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2898 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2902 LOGD("ret : 0x%x", ret);
2907 int camera_attr_get_iso( camera_h camera, camera_attr_iso_e *iso)
2909 if( camera == NULL || iso == NULL){
2910 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2911 return CAMERA_ERROR_INVALID_PARAMETER;
2913 int ret = CAMERA_ERROR_NONE;
2914 camera_cli_s *pc = (camera_cli_s *)camera;
2916 if (pc->cb_info == NULL) {
2917 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2918 return CAMERA_ERROR_INVALID_PARAMETER;
2920 sock_fd = pc->cb_info->fd;
2921 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
2924 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2925 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2927 if (ret == CAMERA_ERROR_NONE) {
2928 muse_camera_msg_get(get_iso, pc->cb_info->recvMsg);
2929 *iso = (camera_attr_iso_e)get_iso;
2931 LOGD("ret : 0x%x", ret);
2936 int camera_attr_get_brightness(camera_h camera, int *level)
2938 if( camera == NULL || level == NULL){
2939 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2940 return CAMERA_ERROR_INVALID_PARAMETER;
2942 int ret = CAMERA_ERROR_NONE;
2943 camera_cli_s *pc = (camera_cli_s *)camera;
2945 if (pc->cb_info == NULL) {
2946 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2947 return CAMERA_ERROR_INVALID_PARAMETER;
2949 sock_fd = pc->cb_info->fd;
2950 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
2953 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2954 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2956 if (ret == CAMERA_ERROR_NONE) {
2957 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
2960 LOGD("ret : 0x%x", ret);
2965 int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
2967 if( camera == NULL || min == NULL || max == NULL ){
2968 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2969 return CAMERA_ERROR_INVALID_PARAMETER;
2971 int ret = CAMERA_ERROR_NONE;
2972 camera_cli_s *pc = (camera_cli_s *)camera;
2974 if (pc->cb_info == NULL) {
2975 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2976 return CAMERA_ERROR_INVALID_PARAMETER;
2978 sock_fd = pc->cb_info->fd;
2979 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
2983 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2984 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2986 if (ret == CAMERA_ERROR_NONE) {
2987 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2988 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2992 LOGD("ret : 0x%x", ret);
2997 int camera_attr_get_contrast(camera_h camera, int *level)
2999 if( camera == NULL || level == NULL){
3000 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3001 return CAMERA_ERROR_INVALID_PARAMETER;
3003 int ret = CAMERA_ERROR_NONE;
3004 camera_cli_s *pc = (camera_cli_s *)camera;
3005 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
3007 if (pc->cb_info == NULL) {
3008 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3009 return CAMERA_ERROR_INVALID_PARAMETER;
3011 sock_fd = pc->cb_info->fd;
3014 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3015 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3017 if (ret == CAMERA_ERROR_NONE) {
3018 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3021 LOGD("ret : 0x%x", ret);
3026 int camera_attr_get_contrast_range(camera_h camera, int *min , int *max)
3028 if( camera == NULL || min == NULL || max == NULL ){
3029 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3030 return CAMERA_ERROR_INVALID_PARAMETER;
3032 int ret = CAMERA_ERROR_NONE;
3033 camera_cli_s *pc = (camera_cli_s *)camera;
3034 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
3036 if (pc->cb_info == NULL) {
3037 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3038 return CAMERA_ERROR_INVALID_PARAMETER;
3040 sock_fd = pc->cb_info->fd;
3044 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3045 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3047 if (ret == CAMERA_ERROR_NONE) {
3048 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3049 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3053 LOGD("ret : 0x%x", ret);
3058 int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
3060 if( camera == NULL || wb == NULL){
3061 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3062 return CAMERA_ERROR_INVALID_PARAMETER;
3064 int ret = CAMERA_ERROR_NONE;
3065 camera_cli_s *pc = (camera_cli_s *)camera;
3066 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
3068 if (pc->cb_info == NULL) {
3069 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3070 return CAMERA_ERROR_INVALID_PARAMETER;
3072 sock_fd = pc->cb_info->fd;
3075 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3076 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3078 if (ret == CAMERA_ERROR_NONE) {
3079 muse_camera_msg_get(get_wb, pc->cb_info->recvMsg);
3080 *wb = (camera_attr_whitebalance_e)get_wb;
3082 LOGD("ret : 0x%x", ret);
3087 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
3089 if( camera == NULL || effect == NULL ){
3090 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3091 return CAMERA_ERROR_INVALID_PARAMETER;
3094 int ret = CAMERA_ERROR_NONE;
3095 camera_cli_s *pc = (camera_cli_s *)camera;
3096 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
3098 if (pc->cb_info == NULL) {
3099 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3100 return CAMERA_ERROR_INVALID_PARAMETER;
3102 sock_fd = pc->cb_info->fd;
3105 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3106 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3108 if (ret == CAMERA_ERROR_NONE) {
3109 muse_camera_msg_get(get_effect, pc->cb_info->recvMsg);
3110 *effect = (camera_attr_effect_mode_e)get_effect;
3112 LOGD("ret : 0x%x", ret);
3117 int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
3119 if( camera == NULL || mode == NULL){
3120 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3121 return CAMERA_ERROR_INVALID_PARAMETER;
3124 int ret = CAMERA_ERROR_NONE;
3125 camera_cli_s *pc = (camera_cli_s *)camera;
3126 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
3128 if (pc->cb_info == NULL) {
3129 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3130 return CAMERA_ERROR_INVALID_PARAMETER;
3132 sock_fd = pc->cb_info->fd;
3135 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3136 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3138 if (ret == CAMERA_ERROR_NONE) {
3139 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3140 *mode = (camera_attr_scene_mode_e)get_mode;
3142 LOGD("ret : 0x%x", ret);
3147 int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
3149 if( camera == NULL || enable == NULL){
3150 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3151 return CAMERA_ERROR_INVALID_PARAMETER;
3154 int ret = CAMERA_ERROR_NONE;
3155 camera_cli_s *pc = (camera_cli_s *)camera;
3156 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
3158 if (pc->cb_info == NULL) {
3159 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3160 return CAMERA_ERROR_INVALID_PARAMETER;
3162 sock_fd = pc->cb_info->fd;
3165 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3166 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3168 if (ret == CAMERA_ERROR_NONE) {
3169 muse_camera_msg_get(get_enable, pc->cb_info->recvMsg);
3170 *enable = (bool)get_enable;
3172 LOGD("ret : 0x%x", ret);
3177 int camera_attr_get_tag_image_description(camera_h camera, char **description)
3179 if( camera == NULL || description == NULL){
3180 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3181 return CAMERA_ERROR_INVALID_PARAMETER;
3184 int ret = CAMERA_ERROR_NONE;
3185 camera_cli_s *pc = (camera_cli_s *)camera;
3186 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
3188 if (pc->cb_info == NULL) {
3189 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3190 return CAMERA_ERROR_INVALID_PARAMETER;
3192 sock_fd = pc->cb_info->fd;
3193 char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3195 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3196 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3198 if (ret == CAMERA_ERROR_NONE) {
3199 muse_camera_msg_get_string(get_description, pc->cb_info->recvMsg);
3200 *description = strdup(get_description);
3202 LOGD("ret : 0x%x", ret);
3207 int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
3209 if( camera == NULL || orientation == NULL){
3210 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3211 return CAMERA_ERROR_INVALID_PARAMETER;
3214 int ret = CAMERA_ERROR_NONE;
3215 camera_cli_s *pc = (camera_cli_s *)camera;
3216 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
3218 if (pc->cb_info == NULL) {
3219 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3220 return CAMERA_ERROR_INVALID_PARAMETER;
3222 sock_fd = pc->cb_info->fd;
3223 int get_orientation;
3225 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3226 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3228 if (ret == CAMERA_ERROR_NONE) {
3229 muse_camera_msg_get(get_orientation, pc->cb_info->recvMsg);
3230 *orientation = (camera_attr_tag_orientation_e)get_orientation;
3231 LOGD("success, orientation : %d", *orientation);
3233 LOGD("ret : 0x%x", ret);
3238 int camera_attr_get_tag_software(camera_h camera, char **software)
3240 if( camera == NULL || software == NULL ){
3241 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3242 return CAMERA_ERROR_INVALID_PARAMETER;
3245 int ret = CAMERA_ERROR_NONE;
3246 camera_cli_s *pc = (camera_cli_s *)camera;
3247 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
3249 if (pc->cb_info == NULL) {
3250 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3251 return CAMERA_ERROR_INVALID_PARAMETER;
3253 sock_fd = pc->cb_info->fd;
3254 char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3256 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3257 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3259 if (ret == CAMERA_ERROR_NONE) {
3260 muse_camera_msg_get_string(get_software, pc->cb_info->recvMsg);
3261 *software = strdup(get_software);
3263 LOGD("ret : 0x%x", ret);
3268 int camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
3270 if( camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL){
3271 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3272 return CAMERA_ERROR_INVALID_PARAMETER;
3275 int ret = CAMERA_ERROR_NONE;
3276 camera_cli_s *pc = (camera_cli_s *)camera;
3277 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
3278 double get_geotag[3] = {0,};
3280 if (pc->cb_info == NULL) {
3281 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3282 return CAMERA_ERROR_INVALID_PARAMETER;
3284 sock_fd = pc->cb_info->fd;
3286 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3287 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3289 if (ret == CAMERA_ERROR_NONE) {
3290 muse_camera_msg_get_array(get_geotag, pc->cb_info->recvMsg);
3291 *latitude = get_geotag[0];
3292 *longitude = get_geotag[1];
3293 *altitude = get_geotag[2];
3295 LOGE("Returned value is not valid : 0x%x", valid);
3300 LOGD("ret : 0x%x", ret);
3305 int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
3307 if( camera == NULL || mode == NULL){
3308 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3309 return CAMERA_ERROR_INVALID_PARAMETER;
3312 int ret = CAMERA_ERROR_NONE;
3313 camera_cli_s *pc = (camera_cli_s *)camera;
3314 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
3316 if (pc->cb_info == NULL) {
3317 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3318 return CAMERA_ERROR_INVALID_PARAMETER;
3320 sock_fd = pc->cb_info->fd;
3323 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3324 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3326 if (ret == CAMERA_ERROR_NONE) {
3327 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3328 *mode = (camera_attr_flash_mode_e)get_mode;
3330 LOGD("ret : 0x%x", ret);
3335 int camera_attr_foreach_supported_af_mode( camera_h camera, camera_attr_supported_af_mode_cb foreach_cb , void *user_data)
3337 if( camera == NULL || foreach_cb == NULL){
3338 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3339 return CAMERA_ERROR_INVALID_PARAMETER;
3341 int ret = CAMERA_ERROR_NONE;
3343 camera_cli_s *pc = (camera_cli_s *)camera;
3344 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
3346 LOGD("Enter, handle :%x", pc->remote_handle);
3349 if (pc->cb_info == NULL) {
3350 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3351 return CAMERA_ERROR_INVALID_PARAMETER;
3353 sock_fd = pc->cb_info->fd;
3354 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
3355 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
3357 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3358 LOGD("ret : 0x%x", ret);
3363 int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb , void *user_data)
3365 if( camera == NULL || foreach_cb == NULL){
3366 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3367 return CAMERA_ERROR_INVALID_PARAMETER;
3369 int ret = CAMERA_ERROR_NONE;
3371 camera_cli_s *pc = (camera_cli_s *)camera;
3372 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
3374 LOGD("Enter, handle :%x", pc->remote_handle);
3377 if (pc->cb_info == NULL) {
3378 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3379 return CAMERA_ERROR_INVALID_PARAMETER;
3381 sock_fd = pc->cb_info->fd;
3382 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
3383 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
3385 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3386 LOGD("ret : 0x%x", ret);
3391 int camera_attr_foreach_supported_iso( camera_h camera, camera_attr_supported_iso_cb foreach_cb , void *user_data)
3393 if( camera == NULL || foreach_cb == NULL){
3394 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3395 return CAMERA_ERROR_INVALID_PARAMETER;
3397 int ret = CAMERA_ERROR_NONE;
3399 camera_cli_s *pc = (camera_cli_s *)camera;
3400 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
3402 LOGD("Enter, handle :%x", pc->remote_handle);
3405 if (pc->cb_info == NULL) {
3406 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3407 return CAMERA_ERROR_INVALID_PARAMETER;
3409 sock_fd = pc->cb_info->fd;
3410 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
3411 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
3413 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3414 LOGD("ret : 0x%x", ret);
3419 int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb , void *user_data)
3421 if( camera == NULL || foreach_cb == NULL){
3422 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3423 return CAMERA_ERROR_INVALID_PARAMETER;
3425 int ret = CAMERA_ERROR_NONE;
3427 camera_cli_s *pc = (camera_cli_s *)camera;
3428 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
3430 LOGD("Enter, handle :%x", pc->remote_handle);
3433 if (pc->cb_info == NULL) {
3434 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3435 return CAMERA_ERROR_INVALID_PARAMETER;
3437 sock_fd = pc->cb_info->fd;
3438 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
3439 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
3441 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3442 LOGD("ret : 0x%x", ret);
3447 int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb , void *user_data)
3449 if( camera == NULL || foreach_cb == NULL){
3450 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3451 return CAMERA_ERROR_INVALID_PARAMETER;
3453 int ret = CAMERA_ERROR_NONE;
3455 camera_cli_s *pc = (camera_cli_s *)camera;
3456 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
3458 LOGD("Enter, handle :%x", pc->remote_handle);
3461 if (pc->cb_info == NULL) {
3462 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3463 return CAMERA_ERROR_INVALID_PARAMETER;
3465 sock_fd = pc->cb_info->fd;
3466 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
3467 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
3469 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3470 LOGD("ret : 0x%x", ret);
3475 int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb , void *user_data)
3477 if( camera == NULL || foreach_cb == NULL){
3478 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3479 return CAMERA_ERROR_INVALID_PARAMETER;
3481 int ret = CAMERA_ERROR_NONE;
3483 camera_cli_s *pc = (camera_cli_s *)camera;
3484 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
3486 LOGD("Enter, handle :%x", pc->remote_handle);
3489 if (pc->cb_info == NULL) {
3490 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3491 return CAMERA_ERROR_INVALID_PARAMETER;
3493 sock_fd = pc->cb_info->fd;
3494 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
3495 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
3497 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3498 LOGD("ret : 0x%x", ret);
3503 int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb , void *user_data)
3505 if( camera == NULL || foreach_cb == NULL){
3506 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3507 return CAMERA_ERROR_INVALID_PARAMETER;
3509 int ret = CAMERA_ERROR_NONE;
3511 camera_cli_s *pc = (camera_cli_s *)camera;
3512 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
3514 LOGD("Enter, handle :%x", pc->remote_handle);
3517 if (pc->cb_info == NULL) {
3518 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3519 return CAMERA_ERROR_INVALID_PARAMETER;
3521 sock_fd = pc->cb_info->fd;
3522 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
3523 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = user_data;
3525 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3526 LOGD("ret : 0x%x", ret);
3531 int camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb foreach_cb , void *user_data)
3533 if( camera == NULL || foreach_cb == NULL){
3534 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3535 return CAMERA_ERROR_INVALID_PARAMETER;
3537 int ret = CAMERA_ERROR_NONE;
3539 camera_cli_s *pc = (camera_cli_s *)camera;
3540 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS;
3542 if (pc->cb_info == NULL) {
3543 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3544 return CAMERA_ERROR_INVALID_PARAMETER;
3546 sock_fd = pc->cb_info->fd;
3547 LOGD("Enter, handle :%x", pc->remote_handle);
3548 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = foreach_cb;
3549 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
3551 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3552 LOGD("Enter, handle :%x", pc->remote_handle);
3556 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)
3558 if( camera == NULL || foreach_cb == NULL){
3559 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3560 return CAMERA_ERROR_INVALID_PARAMETER;
3562 int ret = CAMERA_ERROR_NONE;
3564 camera_cli_s *pc = (camera_cli_s *)camera;
3565 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
3567 if (pc->cb_info == NULL) {
3568 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3569 return CAMERA_ERROR_INVALID_PARAMETER;
3571 sock_fd = pc->cb_info->fd;
3572 LOGD("Enter, handle :%x", pc->remote_handle);
3573 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = foreach_cb;
3574 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = user_data;
3576 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
3577 LOGD("ret : 0x%x", ret);
3581 int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
3583 if( camera == NULL || foreach_cb == NULL){
3584 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3585 return CAMERA_ERROR_INVALID_PARAMETER;
3587 int ret = CAMERA_ERROR_NONE;
3589 camera_cli_s *pc = (camera_cli_s *)camera;
3590 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
3592 if (pc->cb_info == NULL) {
3593 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3594 return CAMERA_ERROR_INVALID_PARAMETER;
3596 sock_fd = pc->cb_info->fd;
3597 LOGD("Enter, handle :%x", pc->remote_handle);
3598 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
3599 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
3601 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3602 LOGD("ret : 0x%x", ret);
3607 int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
3609 if( camera == NULL || foreach_cb == NULL){
3610 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3611 return CAMERA_ERROR_INVALID_PARAMETER;
3613 int ret = CAMERA_ERROR_NONE;
3615 camera_cli_s *pc = (camera_cli_s *)camera;
3616 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION;
3618 if (pc->cb_info == NULL) {
3619 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3620 return CAMERA_ERROR_INVALID_PARAMETER;
3622 sock_fd = pc->cb_info->fd;
3623 LOGD("Enter, handle :%x", pc->remote_handle);
3624 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
3625 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
3627 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3628 LOGD("ret : 0x%x", ret);
3633 int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation)
3635 if( camera == NULL){
3636 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3637 return CAMERA_ERROR_INVALID_PARAMETER;
3640 int ret = CAMERA_ERROR_NONE;
3641 camera_cli_s *pc = (camera_cli_s *)camera;
3642 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
3644 if (pc->cb_info == NULL) {
3645 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3646 return CAMERA_ERROR_INVALID_PARAMETER;
3648 sock_fd = pc->cb_info->fd;
3649 int set_rotation = (int)rotation;
3651 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3652 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
3653 LOGD("ret : 0x%x", ret);
3658 int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation)
3660 if( camera == NULL || rotation == NULL ){
3661 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3662 return CAMERA_ERROR_INVALID_PARAMETER;
3665 int ret = CAMERA_ERROR_NONE;
3666 camera_cli_s *pc = (camera_cli_s *)camera;
3667 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
3669 if (pc->cb_info == NULL) {
3670 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3671 return CAMERA_ERROR_INVALID_PARAMETER;
3673 sock_fd = pc->cb_info->fd;
3676 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3677 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3679 if (ret == CAMERA_ERROR_NONE) {
3680 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
3681 *rotation = (camera_rotation_e)get_rotation;
3683 LOGD("ret : 0x%x", ret);
3688 int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip)
3690 if( camera == NULL){
3691 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3692 return CAMERA_ERROR_INVALID_PARAMETER;
3695 int ret = CAMERA_ERROR_NONE;
3696 camera_cli_s *pc = (camera_cli_s *)camera;
3697 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
3699 if (pc->cb_info == NULL) {
3700 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3701 return CAMERA_ERROR_INVALID_PARAMETER;
3703 sock_fd = pc->cb_info->fd;
3704 int set_flip = (int)flip;
3706 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3707 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
3708 LOGD("ret : 0x%x", ret);
3713 int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip)
3715 if( camera == NULL || flip == NULL ){
3716 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3717 return CAMERA_ERROR_INVALID_PARAMETER;
3720 int ret = CAMERA_ERROR_NONE;
3721 camera_cli_s *pc = (camera_cli_s *)camera;
3722 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
3724 if (pc->cb_info == NULL) {
3725 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3726 return CAMERA_ERROR_INVALID_PARAMETER;
3728 sock_fd = pc->cb_info->fd;
3731 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3732 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3734 if (ret == CAMERA_ERROR_NONE) {
3735 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
3736 *flip = (camera_flip_e)get_flip;
3738 LOGD("ret : 0x%x", ret);
3742 int camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
3744 if( camera == NULL){
3745 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3746 return CAMERA_ERROR_INVALID_PARAMETER;
3749 int ret = CAMERA_ERROR_NONE;
3750 camera_cli_s *pc = (camera_cli_s *)camera;
3751 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
3753 if (pc->cb_info == NULL) {
3754 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3755 return CAMERA_ERROR_INVALID_PARAMETER;
3757 sock_fd = pc->cb_info->fd;
3758 int set_mode = (int)mode;
3760 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3761 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3762 LOGD("ret : 0x%x", ret);
3767 int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
3769 if (camera == NULL) {
3770 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
3771 return CAMERA_ERROR_INVALID_PARAMETER;
3774 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - mode",CAMERA_ERROR_NOT_SUPPORTED);
3775 return CAMERA_ERROR_NOT_SUPPORTED;
3777 int ret = CAMERA_ERROR_NONE;
3778 camera_cli_s *pc = (camera_cli_s *)camera;
3779 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
3781 if (pc->cb_info == NULL) {
3782 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3783 return CAMERA_ERROR_INVALID_PARAMETER;
3785 sock_fd = pc->cb_info->fd;
3788 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3789 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3791 if (ret == CAMERA_ERROR_NONE) {
3792 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3793 *mode = (camera_attr_hdr_mode_e)get_mode;
3795 LOGD("ret : 0x%x", ret);
3800 bool camera_attr_is_supported_hdr_capture(camera_h camera)
3802 if( camera == NULL){
3803 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3807 int ret = CAMERA_ERROR_NONE;
3808 camera_cli_s *pc = (camera_cli_s *)camera;
3809 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
3811 if (pc->cb_info == NULL) {
3812 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3813 return CAMERA_ERROR_INVALID_PARAMETER;
3815 sock_fd = pc->cb_info->fd;
3816 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3817 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3818 LOGD("ret : 0x%x", ret);
3823 int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data)
3825 if (camera == NULL) {
3826 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3827 return CAMERA_ERROR_INVALID_PARAMETER;
3829 if (callback == NULL) {
3830 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - callback", CAMERA_ERROR_NOT_SUPPORTED);
3831 return CAMERA_ERROR_NOT_SUPPORTED;
3833 int ret = CAMERA_ERROR_NONE;
3835 camera_cli_s *pc = (camera_cli_s *)camera;
3836 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
3838 if (pc->cb_info == NULL) {
3839 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3840 return CAMERA_ERROR_INVALID_PARAMETER;
3842 sock_fd = pc->cb_info->fd;
3843 LOGD("Enter, handle :%x", pc->remote_handle);
3845 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = callback;
3846 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = user_data;
3848 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3849 LOGD("ret : 0x%x", ret);
3854 int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
3856 if( camera == NULL){
3857 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3858 return CAMERA_ERROR_INVALID_PARAMETER;
3861 int ret = CAMERA_ERROR_NONE;
3863 camera_cli_s *pc = (camera_cli_s *)camera;
3864 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
3866 if (pc->cb_info == NULL) {
3867 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3868 return CAMERA_ERROR_INVALID_PARAMETER;
3870 sock_fd = pc->cb_info->fd;
3871 LOGD("Enter, handle :%x", pc->remote_handle);
3873 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3874 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3876 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3877 LOGD("ret : 0x%x", ret);
3882 int camera_attr_enable_anti_shake(camera_h camera, bool enable)
3884 if (camera == NULL) {
3885 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3886 return CAMERA_ERROR_INVALID_PARAMETER;
3889 int ret = CAMERA_ERROR_NONE;
3890 camera_cli_s *pc = (camera_cli_s *)camera;
3891 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
3893 if (pc->cb_info == NULL) {
3894 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3895 return CAMERA_ERROR_INVALID_PARAMETER;
3897 sock_fd = pc->cb_info->fd;
3898 int set_enable = (int)enable;
3900 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3901 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3902 LOGD("ret : 0x%x", ret);
3907 int camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled)
3909 if (camera == NULL) {
3910 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3911 return CAMERA_ERROR_INVALID_PARAMETER;
3913 if (enabled == NULL) {
3914 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
3915 return CAMERA_ERROR_NOT_SUPPORTED;
3917 int ret = CAMERA_ERROR_NONE;
3918 camera_cli_s *pc = (camera_cli_s *)camera;
3919 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
3921 if (pc->cb_info == NULL) {
3922 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3923 return CAMERA_ERROR_INVALID_PARAMETER;
3925 sock_fd = pc->cb_info->fd;
3928 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3929 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3931 if (ret == CAMERA_ERROR_NONE) {
3932 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
3933 *enabled = (bool)get_enabled;
3935 LOGD("ret : 0x%x", ret);
3940 bool camera_attr_is_supported_anti_shake(camera_h camera)
3943 if( camera == NULL){
3944 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3948 int ret = CAMERA_ERROR_NONE;
3949 camera_cli_s *pc = (camera_cli_s *)camera;
3950 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
3952 if (pc->cb_info == NULL) {
3953 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3954 return CAMERA_ERROR_INVALID_PARAMETER;
3956 sock_fd = pc->cb_info->fd;
3957 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3958 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3959 LOGD("ret : 0x%x", ret);
3964 int camera_attr_enable_video_stabilization(camera_h camera, bool enable)
3966 if (camera == NULL) {
3967 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3968 return CAMERA_ERROR_INVALID_PARAMETER;
3971 int ret = CAMERA_ERROR_NONE;
3972 camera_cli_s *pc = (camera_cli_s *)camera;
3973 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
3975 if (pc->cb_info == NULL) {
3976 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3977 return CAMERA_ERROR_INVALID_PARAMETER;
3979 sock_fd = pc->cb_info->fd;
3980 int set_enable = (int)enable;
3982 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3983 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3984 LOGD("ret : 0x%x", ret);
3989 int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
3991 if (camera == NULL) {
3992 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
3993 return CAMERA_ERROR_INVALID_PARAMETER;
3995 if (enabled == NULL) {
3996 LOGE("INVALID_PARAMETER(0x%08x) - enabled",CAMERA_ERROR_INVALID_PARAMETER);
3997 return CAMERA_ERROR_NOT_SUPPORTED;
3999 int ret = CAMERA_ERROR_NONE;
4000 camera_cli_s *pc = (camera_cli_s *)camera;
4001 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
4003 if (pc->cb_info == NULL) {
4004 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4005 return CAMERA_ERROR_INVALID_PARAMETER;
4007 sock_fd = pc->cb_info->fd;
4010 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4011 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4013 if (ret == CAMERA_ERROR_NONE) {
4014 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4015 *enabled = (bool)get_enabled;
4017 LOGD("ret : 0x%x", ret);
4022 bool camera_attr_is_supported_video_stabilization(camera_h camera)
4024 if( camera == NULL){
4025 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4029 int ret = CAMERA_ERROR_NONE;
4030 camera_cli_s *pc = (camera_cli_s *)camera;
4031 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
4033 if (pc->cb_info == NULL) {
4034 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4035 return CAMERA_ERROR_INVALID_PARAMETER;
4037 sock_fd = pc->cb_info->fd;
4038 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4039 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4040 LOGD("ret : 0x%x", ret);
4045 int camera_attr_enable_auto_contrast(camera_h camera, bool enable)
4047 if( camera == NULL){
4048 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4049 return CAMERA_ERROR_INVALID_PARAMETER;
4052 int ret = CAMERA_ERROR_NONE;
4053 camera_cli_s *pc = (camera_cli_s *)camera;
4054 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
4056 if (pc->cb_info == NULL) {
4057 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4058 return CAMERA_ERROR_INVALID_PARAMETER;
4060 sock_fd = pc->cb_info->fd;
4061 int set_enable = (int)enable;
4063 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4064 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4065 LOGD("ret : 0x%x", ret);
4070 int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
4072 if (camera == NULL) {
4073 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4074 return CAMERA_ERROR_INVALID_PARAMETER;
4076 if (enabled == NULL) {
4077 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4078 return CAMERA_ERROR_INVALID_PARAMETER;
4080 int ret = CAMERA_ERROR_NONE;
4081 camera_cli_s *pc = (camera_cli_s *)camera;
4082 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
4084 if (pc->cb_info == NULL) {
4085 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4086 return CAMERA_ERROR_INVALID_PARAMETER;
4088 sock_fd = pc->cb_info->fd;
4091 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4092 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4094 if (ret == CAMERA_ERROR_NONE) {
4095 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4096 *enabled = (bool)get_enabled;
4098 LOGD("ret : 0x%x", ret);
4103 bool camera_attr_is_supported_auto_contrast(camera_h camera)
4105 if( camera == NULL){
4106 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4110 int ret = CAMERA_ERROR_NONE;
4111 camera_cli_s *pc = (camera_cli_s *)camera;
4112 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
4114 if (pc->cb_info == NULL) {
4115 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4116 return CAMERA_ERROR_INVALID_PARAMETER;
4118 sock_fd = pc->cb_info->fd;
4119 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4120 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4121 LOGD("ret : 0x%x", ret);
4126 int camera_attr_disable_shutter_sound(camera_h camera, bool disable)
4128 if (camera == NULL) {
4129 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4130 return CAMERA_ERROR_INVALID_PARAMETER;
4133 int ret = CAMERA_ERROR_NONE;
4134 camera_cli_s *pc = (camera_cli_s *)camera;
4135 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
4137 if (pc->cb_info == NULL) {
4138 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4139 return CAMERA_ERROR_INVALID_PARAMETER;
4141 sock_fd = pc->cb_info->fd;
4142 int set_disable = (int)disable;
4144 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4145 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_disable);
4146 LOGD("ret : 0x%x", ret);