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, char *recvMsg, muse_camera_event_e event)
90 if (recvMsg == NULL) {
91 LOGE("NULL message for event %d", event);
95 LOGD("get event %d", event);
98 case MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE:
100 int cb_previous, cb_current, cb_by_policy;
101 muse_camera_msg_get(cb_previous, recvMsg);
102 muse_camera_msg_get(cb_current, recvMsg);
103 muse_camera_msg_get(cb_by_policy, recvMsg);
104 ((camera_state_changed_cb)cb_info->user_cb[event])((camera_state_e)cb_previous,
105 (camera_state_e)cb_current,
107 cb_info->user_data[event]);
110 case MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE:
113 muse_camera_msg_get(cb_state, recvMsg);
114 ((camera_focus_changed_cb)cb_info->user_cb[event])((camera_focus_state_e)cb_state,
115 cb_info->user_data[event]);
118 case MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE:
119 ((camera_capture_completed_cb)cb_info->user_cb[event])(cb_info->user_data[event]);
121 case MUSE_CAMERA_EVENT_TYPE_PREVIEW:
124 tbm_bo_handle bo_handle;
126 unsigned char *buf_pos = NULL;
127 camera_preview_data_s *frame = NULL;
128 muse_camera_msg_get(tbm_key, recvMsg);
131 LOGE("invalid key %d", tbm_key);
135 /* import tbm bo and get virtual address */
136 bo = tbm_bo_import(cb_info->bufmgr, tbm_key);
138 LOGE("bo import failed - bufmgr %p, key %d", cb_info->bufmgr, tbm_key);
142 bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
143 if (bo_handle.ptr == NULL) {
144 LOGE("bo map failed %p", bo);
149 buf_pos = (unsigned char *)bo_handle.ptr;
151 frame = (camera_preview_data_s *)buf_pos;
153 buf_pos += sizeof(camera_preview_data_s);
155 switch (frame->num_of_planes) {
157 frame->data.single_plane.yuv = buf_pos;
159 frame->data.double_plane.y = buf_pos;
160 buf_pos += frame->data.double_plane.y_size;
161 frame->data.double_plane.uv = buf_pos;
163 frame->data.triple_plane.y = buf_pos;
164 buf_pos += frame->data.triple_plane.y_size;
165 frame->data.triple_plane.u = buf_pos;
166 buf_pos += frame->data.triple_plane.u_size;
167 frame->data.triple_plane.v = buf_pos;
171 if (cb_info->user_cb[event]) {
172 ((camera_preview_cb)cb_info->user_cb[event])(frame,
173 cb_info->user_data[event]);
175 LOGW("preview cb is NULL");
179 muse_camera_msg_send1_no_return(MUSE_CAMERA_API_RETURN_BUFFER,
184 LOGD("return buffer Done");
186 /* unmap and unref tbm bo */
193 case MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW:
194 ((camera_media_packet_preview_cb)cb_info->user_cb[event])(NULL,
195 cb_info->user_data[event]);
197 case MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS:
200 muse_camera_msg_get(progress, recvMsg);
201 ((camera_attr_hdr_progress_cb)cb_info->user_cb[event])(progress,
202 cb_info->user_data[event]);
205 case MUSE_CAMERA_EVENT_TYPE_INTERRUPTED:
207 int cb_policy, cb_previous, cb_current;
208 muse_camera_msg_get(cb_policy, recvMsg);
209 muse_camera_msg_get(cb_previous, recvMsg);
210 muse_camera_msg_get(cb_current, recvMsg);
211 ((camera_interrupted_cb)cb_info->user_cb[event])((camera_policy_e)cb_policy,
212 (camera_state_e)cb_previous,
213 (camera_state_e)cb_current,
214 cb_info->user_data[event]);
217 case MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION:
220 muse_camera_msg_get(count, recvMsg);
221 ((camera_face_detected_cb)cb_info->user_cb[event])(NULL,
223 cb_info->user_data[event]);
226 case MUSE_CAMERA_EVENT_TYPE_ERROR:
228 int cb_error, cb_current_state;
229 muse_camera_msg_get(cb_error, recvMsg);
230 muse_camera_msg_get(cb_current_state, recvMsg);
231 ((camera_error_cb)cb_info->user_cb[event])((camera_error_e)cb_error,
232 (camera_state_e)cb_current_state,
233 cb_info->user_data[event]);
236 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
237 muse_camera_msg_get(param1, recvMsg);
238 muse_camera_msg_get(param2, recvMsg);
239 ((camera_supported_preview_resolution_cb)cb_info->user_cb[event])(param1, param2,
240 cb_info->user_data[event]);
242 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
243 muse_camera_msg_get(param1, recvMsg);
244 muse_camera_msg_get(param2, recvMsg);
245 ((camera_supported_capture_resolution_cb)cb_info->user_cb[event])(param1, param2,
246 cb_info->user_data[event]);
248 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
249 muse_camera_msg_get(param, recvMsg);
250 ((camera_supported_capture_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
251 cb_info->user_data[event]);
253 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
254 muse_camera_msg_get(param, recvMsg);
255 ((camera_supported_preview_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
256 cb_info->user_data[event]);
258 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
259 muse_camera_msg_get(param, recvMsg);
260 ((camera_attr_supported_af_mode_cb)cb_info->user_cb[event])((camera_attr_af_mode_e)param,
261 cb_info->user_data[event]);
263 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
264 muse_camera_msg_get(param, recvMsg);
265 ((camera_attr_supported_exposure_mode_cb)cb_info->user_cb[event])((camera_attr_exposure_mode_e)param,
266 cb_info->user_data[event]);
268 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
269 muse_camera_msg_get(param, recvMsg);
270 ((camera_attr_supported_iso_cb)cb_info->user_cb[event])((camera_attr_iso_e)param,
271 cb_info->user_data[event]);
273 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
274 muse_camera_msg_get(param, recvMsg);
275 ((camera_attr_supported_whitebalance_cb)cb_info->user_cb[event])((camera_attr_whitebalance_e)param,
276 cb_info->user_data[event]);
278 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
279 muse_camera_msg_get(param, recvMsg);
280 ((camera_attr_supported_effect_cb)cb_info->user_cb[event])((camera_attr_effect_mode_e)param,
281 cb_info->user_data[event]);
283 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
284 muse_camera_msg_get(param, recvMsg);
285 ((camera_attr_supported_scene_mode_cb)cb_info->user_cb[event])((camera_attr_scene_mode_e)param,
286 cb_info->user_data[event]);
288 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
289 muse_camera_msg_get(param, recvMsg);
290 ((camera_attr_supported_flash_mode_cb)cb_info->user_cb[event])((camera_attr_flash_mode_e)param,
291 cb_info->user_data[event]);
293 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
294 muse_camera_msg_get(param, recvMsg);
295 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
296 cb_info->user_data[event]);
298 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
299 muse_camera_msg_get(param, recvMsg);
300 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
301 cb_info->user_data[event]);
303 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
304 muse_camera_msg_get(param, recvMsg);
305 ((camera_attr_supported_stream_flip_cb)cb_info->user_cb[event])((camera_flip_e)param,
306 cb_info->user_data[event]);
308 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
309 muse_camera_msg_get(param, recvMsg);
310 ((camera_attr_supported_stream_rotation_cb)cb_info->user_cb[event])((camera_rotation_e)param,
311 cb_info->user_data[event]);
313 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
314 muse_camera_msg_get(param, recvMsg);
315 ((camera_attr_supported_theater_mode_cb)cb_info->user_cb[event])((camera_attr_theater_mode_e)param,
316 cb_info->user_data[event]);
318 case MUSE_CAMERA_EVENT_TYPE_CAPTURE:
320 camera_image_data_s *rImage = NULL;
321 camera_image_data_s *rPostview = NULL;
322 camera_image_data_s *rThumbnail = NULL;
323 unsigned char *buf_pos = NULL;
325 tbm_bo_handle bo_handle;
328 int is_thumbnail = 0;
330 muse_camera_msg_get(tbm_key, recvMsg);
331 muse_camera_msg_get(is_postview, recvMsg);
332 muse_camera_msg_get(is_thumbnail, recvMsg);
334 LOGD("camera capture callback came in. key %d, postview %d, thumbnail %d",
335 tbm_key, is_postview, is_thumbnail);
338 LOGE("invalid key %d", tbm_key);
342 /* import tbm bo and get virtual address */
343 bo = tbm_bo_import(cb_info->bufmgr, tbm_key);
345 LOGE("bo import failed - bufmgr %p, key %d", cb_info->bufmgr, tbm_key);
349 bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
350 if (bo_handle.ptr == NULL) {
351 LOGE("bo map failed %p", bo);
357 buf_pos = (unsigned char *)bo_handle.ptr;
358 rImage = (camera_image_data_s *)buf_pos;
359 rImage->data = buf_pos + sizeof(camera_image_data_s);
360 buf_pos += sizeof(camera_image_data_s) + rImage->size;
363 rPostview = (camera_image_data_s *)buf_pos;
364 LOGD("rPostview->size : %d", rPostview->size);
365 rPostview->data = buf_pos + sizeof(camera_image_data_s);
366 buf_pos += sizeof(camera_image_data_s) + rPostview->size;
370 rThumbnail = (camera_image_data_s *)buf_pos;
371 LOGD("rThumbnail->size : %d", rThumbnail->size);
372 rThumbnail->data = buf_pos + sizeof(camera_image_data_s);
373 buf_pos += sizeof(camera_image_data_s) + rThumbnail->size;
376 LOGD("read image info height: %d, width : %d, size : %d", rImage->height, rImage->width, rImage->size);
378 if (cb_info->user_cb[event]) {
379 ((camera_capturing_cb)cb_info->user_cb[event])(rImage, rPostview, rThumbnail, cb_info->user_data[event]);
381 LOGW("capture cb is NULL");
385 muse_camera_msg_send1_no_return(MUSE_CAMERA_API_RETURN_BUFFER,
390 LOGD("return buffer done");
392 /* unmap and unref tbm bo */
399 case MUSE_CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR:
403 LOGE("Unknonw event : %d", event);
410 static void *_event_handler(gpointer data)
412 event_info_s *e_info = NULL;
413 callback_cb_info_s *cb_info = (callback_cb_info_s *)data;
415 if (cb_info == NULL) {
416 LOGE("cb_info NULL");
422 g_mutex_lock(&cb_info->event_mutex);
424 while (g_atomic_int_get(&cb_info->event_thread_running)) {
425 if (g_queue_is_empty(cb_info->event_queue)) {
426 LOGD("signal wait...");
427 g_cond_wait(&cb_info->event_cond, &cb_info->event_mutex);
428 LOGD("signal received");
430 if (g_atomic_int_get(&cb_info->event_thread_running) == 0) {
431 LOGD("stop event thread");
436 e_info = (event_info_s *)g_queue_pop_head(cb_info->event_queue);
438 g_mutex_unlock(&cb_info->event_mutex);
441 _client_user_callback(e_info->cb_info, e_info->recvMsg, e_info->event);
445 LOGW("NULL event info");
448 g_mutex_lock(&cb_info->event_mutex);
451 /* remove remained event */
452 while (!g_queue_is_empty(cb_info->event_queue)) {
453 e_info = (event_info_s *)g_queue_pop_head(cb_info->event_queue);
455 LOGD("remove event info %p", e_info);
459 LOGW("NULL event info");
463 g_mutex_unlock(&cb_info->event_mutex);
470 static bool _camera_idle_event_callback(void *data)
472 event_info_s *e_info = (event_info_s *)data;
474 if (e_info == NULL) {
475 LOGE("event info is NULL");
479 _client_user_callback(e_info->cb_info, e_info->recvMsg, e_info->event);
486 static void *client_cb_handler(gpointer data)
494 callback_cb_info_s *cb_info = (callback_cb_info_s *)data;
495 char *recvMsg = NULL;
496 char **parseStr = NULL;
498 if (cb_info == NULL) {
499 LOGE("cb_info NULL");
505 parseStr = (char **)malloc(sizeof(char *) * CAMERA_PARSE_STRING_SIZE);
506 if (parseStr == NULL) {
507 LOGE("parseStr malloc failed");
511 for (i = 0 ; i < CAMERA_PARSE_STRING_SIZE ; i++) {
512 parseStr[i] = (char *)malloc(sizeof(char) * MUSE_CAMERA_MSG_MAX_LENGTH);
513 if (parseStr[i] == NULL) {
514 LOGE("parseStr[%d] malloc failed", i);
515 goto CB_HANDLER_EXIT;
519 recvMsg = cb_info->recvMsg;
521 while (g_atomic_int_get(&cb_info->rcv_thread_running)) {
522 ret = muse_core_ipc_recv_msg(cb_info->fd, recvMsg);
531 LOGD("recvMSg : %s, length : %d", recvMsg, ret);
533 /* Need to split the combined entering msgs.
534 This module supports up to 200 combined msgs. */
535 for (str_pos = 0; str_pos < ret; str_pos++) {
536 if(recvMsg[str_pos] == '}') {
537 memset(parseStr[num_token], 0x0, sizeof(char) * MUSE_CAMERA_MSG_MAX_LENGTH);
538 strncpy(parseStr[num_token], recvMsg + prev_pos, str_pos - prev_pos + 1);
539 LOGD("splitted msg : [%s], Index : %d", parseStr[num_token], num_token);
540 prev_pos = str_pos+1;
545 LOGD("num_token : %d", num_token);
547 /* Re-construct to the useful single msg. */
548 for (i = 0; i < num_token; i++) {
550 if (i >= CAMERA_PARSE_STRING_SIZE)
553 if (muse_camera_msg_get(api, parseStr[i])) {
554 if(api < MUSE_CAMERA_API_MAX){
555 LOGD("Set Condition - api %d", api);
556 g_mutex_lock(&(cb_info->pMutex[api]));
558 /* The api msgs should be distinguished from the event msg. */
559 memset(cb_info->recvApiMsg, 0, strlen(cb_info->recvApiMsg));
560 strcpy(cb_info->recvApiMsg, parseStr[i]);
561 LOGD("cb_info->recvApiMsg : [%s]", cb_info->recvApiMsg);
562 cb_info->activating[api] = 1;
563 g_cond_signal(&(cb_info->pCond[api]));
564 g_mutex_unlock(&(cb_info->pMutex[api]));
566 if (api == MUSE_CAMERA_API_CREATE) {
567 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
568 if (ret != CAMERA_ERROR_NONE) {
569 g_atomic_int_set(&cb_info->rcv_thread_running, 0);
570 LOGE("camera create error 0x%x. close client cb handler", ret);
573 LOGE("failed to get api return");
575 } else if (api == MUSE_CAMERA_API_DESTROY) {
576 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
577 if (ret == CAMERA_ERROR_NONE) {
578 g_atomic_int_set(&cb_info->rcv_thread_running, 0);
579 LOGD("camera destroy done. close client cb handler");
582 LOGE("failed to get api return");
585 } else if(api == MUSE_CAMERA_CB_EVENT) {
589 if (muse_camera_msg_get(event, parseStr[i]) &&
590 muse_camera_msg_get(class, parseStr[i])) {
591 event_info_s *e_info = NULL;
593 if (class == MUSE_CAMERA_EVENT_CLASS_NORMAL ||
594 class == MUSE_CAMERA_EVENT_CLASS_IDLE) {
595 e_info = (event_info_s *)malloc(sizeof(event_info_s));
597 e_info->event = event;
598 e_info->cb_info = cb_info;
599 memcpy(e_info->recvMsg, recvMsg, sizeof(e_info->recvMsg));
601 if (class == MUSE_CAMERA_EVENT_CLASS_NORMAL) {
602 LOGD("add event to EVENT QUEUE : %d", event);
603 g_mutex_lock(&cb_info->event_mutex);
604 g_queue_push_tail(cb_info->event_queue, (gpointer)e_info);
605 g_cond_signal(&cb_info->event_cond);
606 g_mutex_unlock(&cb_info->event_mutex);
608 LOGD("add event to IDLE : %d", event);
609 g_idle_add_full(G_PRIORITY_DEFAULT, (GSourceFunc)_camera_idle_event_callback, (gpointer)e_info, NULL);
612 LOGE("e_info alloc failed");
614 } else if (class == MUSE_CAMERA_EVENT_CLASS_IMMEDIATE) {
615 _client_user_callback(cb_info, recvMsg, event);
617 LOGE("unknown class %d", class);
621 LOGW("unknown api : %d", api);
624 LOGE("Get Msg Failed");
630 LOGD("client cb exit");
634 for (i = 0 ; i < CAMERA_PARSE_STRING_SIZE ; i++) {
648 static callback_cb_info_s *client_callback_new(gint sockfd)
650 callback_cb_info_s *cb_info;
652 GMutex *camera_mutex;
654 g_return_val_if_fail(sockfd > 0, NULL);
656 cb_info = g_new0(callback_cb_info_s, 1);
657 camera_cond = g_new0(GCond, MUSE_CAMERA_API_MAX);
658 camera_mutex = g_new0(GMutex, MUSE_CAMERA_API_MAX);
659 camera_activ = g_new0(gint, MUSE_CAMERA_API_MAX);
661 g_atomic_int_set(&cb_info->rcv_thread_running, 1);
662 cb_info->fd = sockfd;
663 cb_info->pCond = camera_cond;
664 cb_info->pMutex = camera_mutex;
665 cb_info->activating = camera_activ;
666 cb_info->msg_rcv_thread = g_thread_new("msg_rcv_thread", client_cb_handler, (gpointer)cb_info);
668 g_atomic_int_set(&cb_info->event_thread_running, 1);
669 g_mutex_init(&cb_info->event_mutex);
670 g_cond_init(&cb_info->event_cond);
671 cb_info->event_queue = g_queue_new();
672 cb_info->event_thread = g_thread_new("event_thread", _event_handler, (gpointer)cb_info);
677 static void client_callback_destroy(callback_cb_info_s * cb_info)
679 g_return_if_fail(cb_info != NULL);
681 LOGI("MSG receive thread[%p] destroy", cb_info->msg_rcv_thread);
683 g_thread_join(cb_info->msg_rcv_thread);
684 g_thread_unref(cb_info->msg_rcv_thread);
685 cb_info->msg_rcv_thread = NULL;
687 LOGD("msg thread removed");
689 g_mutex_lock(&cb_info->event_mutex);
690 g_atomic_int_set(&cb_info->event_thread_running, 0);
691 g_cond_signal(&cb_info->event_cond);
692 g_mutex_unlock(&cb_info->event_mutex);
694 g_thread_join(cb_info->event_thread);
695 g_thread_unref(cb_info->event_thread);
696 cb_info->event_thread = NULL;
698 g_queue_free(cb_info->event_queue);
699 cb_info->event_queue = NULL;
700 g_mutex_clear(&cb_info->event_mutex);
701 g_cond_clear(&cb_info->event_cond);
703 LOGD("event thread removed");
705 if (cb_info->bufmgr) {
706 tbm_bufmgr_deinit(cb_info->bufmgr);
707 cb_info->bufmgr = NULL;
710 if (cb_info->pCond) {
711 g_free(cb_info->pCond);
713 if (cb_info->pMutex) {
714 g_free(cb_info->pMutex);
716 if (cb_info->activating) {
717 g_free(cb_info->activating);
725 int camera_create(camera_device_e device, camera_h* camera)
729 int ret = CAMERA_ERROR_NONE;
731 camera_cli_s *pc = NULL;
732 tbm_bufmgr bufmgr = NULL;
734 muse_camera_api_e api = MUSE_CAMERA_API_CREATE;
735 muse_core_api_module_e muse_module = MUSE_CAMERA;
736 int device_type = (int)device;
739 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
740 return CAMERA_ERROR_INVALID_PARAMETER;
743 bufmgr = tbm_bufmgr_init(-1);
744 if (bufmgr == NULL) {
745 LOGE("get tbm bufmgr failed");
746 return CAMERA_ERROR_INVALID_OPERATION;
749 sock_fd = muse_core_client_new();
751 LOGE("muse_core_client_new failed - returned fd %d", sock_fd);
752 ret = CAMERA_ERROR_INVALID_OPERATION;
758 sndMsg = muse_core_msg_json_factory_new(api,
759 MUSE_TYPE_INT, "module", muse_module,
760 MUSE_TYPE_INT, PARAM_DEVICE_TYPE, device_type,
761 MUSE_TYPE_INT, "pid", pid,
764 muse_core_ipc_send_msg(sock_fd, sndMsg);
765 muse_core_msg_json_factory_free(sndMsg);
767 pc = g_new0(camera_cli_s, 1);
769 ret = CAMERA_ERROR_OUT_OF_MEMORY;
773 pc->cb_info = client_callback_new(sock_fd);
775 LOGD("cb info : %d", pc->cb_info->fd);
777 ret = client_wait_for_cb_return(api, pc->cb_info, CALLBACK_TIME_OUT);
778 if (ret == CAMERA_ERROR_NONE) {
780 muse_camera_msg_get_pointer(handle, pc->cb_info->recvMsg);
782 LOGE("Receiving Handle Failed!!");
783 ret = CAMERA_ERROR_INVALID_OPERATION;
787 pc->remote_handle = handle;
788 pc->cb_info->bufmgr = bufmgr;
790 LOGD("camera create 0x%x", pc->remote_handle);
791 *camera = (camera_h) pc;
799 tbm_bufmgr_deinit(bufmgr);
803 client_callback_destroy(pc->cb_info);
809 LOGE("camera create error : 0x%x", ret);
814 int camera_destroy(camera_h camera)
816 if (camera == NULL) {
817 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
818 return CAMERA_ERROR_INVALID_PARAMETER;
821 int ret = CAMERA_ERROR_NONE;
822 muse_camera_api_e api = MUSE_CAMERA_API_DESTROY;
823 camera_cli_s *pc = (camera_cli_s *)camera;
824 int sock_fd = pc->cb_info->fd;
828 LOGE("pc is already nul!!");
829 return CAMERA_ERROR_INVALID_PARAMETER;
830 } else if (pc->cb_info == NULL) {
831 return CAMERA_ERROR_INVALID_PARAMETER;
834 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
835 if (ret == CAMERA_ERROR_NONE) {
836 client_callback_destroy(pc->cb_info);
840 LOGE("camera destroy error : 0x%x", ret);
846 int camera_start_preview(camera_h camera)
849 if (camera == NULL) {
850 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
851 return CAMERA_ERROR_INVALID_PARAMETER;
854 int ret = CAMERA_ERROR_NONE;
855 muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
856 camera_cli_s *pc = (camera_cli_s *)camera;
858 char caps[MUSE_CAMERA_MSG_MAX_LENGTH] = {0};
860 if (pc->cb_info == NULL) {
861 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
862 return CAMERA_ERROR_INVALID_PARAMETER;
865 sock_fd = pc->cb_info->fd;
867 muse_camera_msg_send_longtime(api, sock_fd, pc->cb_info, ret);
868 LOGD("Enter, ret :0x%x", ret);
869 if(ret == CAMERA_ERROR_NONE) {
870 muse_camera_msg_get_string(caps, pc->cb_info->recvMsg);
871 LOGD("caps : %s", caps);
872 if (pc->cli_display_handle != 0) {
873 LOGD("client's display handle is : 0x%x", pc->cli_display_handle);
874 if(strlen(caps) > 0 &&
875 mm_camcorder_client_realize(pc->client_handle, caps) != MM_ERROR_NONE)
876 ret = CAMERA_ERROR_INVALID_OPERATION;
878 LOGD("display handle is NULL");
881 LOGD("ret : 0x%x", ret);
885 int camera_stop_preview(camera_h camera)
887 if (camera == NULL) {
888 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
889 return CAMERA_ERROR_INVALID_PARAMETER;
891 int ret = CAMERA_ERROR_NONE;
892 camera_cli_s *pc = (camera_cli_s *)camera;
894 muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
896 if (pc->cb_info == NULL) {
897 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
898 return CAMERA_ERROR_INVALID_PARAMETER;
901 sock_fd = pc->cb_info->fd;
903 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
905 if(ret == CAMERA_ERROR_NONE) {
906 if (pc->cli_display_handle != 0) {
907 LOGD("Unrealize client");
908 if (pc->client_handle != NULL) {
909 ret = mm_camcorder_client_unrealize(pc->client_handle);
910 mm_camcorder_client_destroy(pc->client_handle);
913 LOGD("Client did not realized : Display handle is NULL");
916 LOGD("ret : 0x%x", ret);
920 int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data)
922 if (camera == NULL) {
923 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
924 return CAMERA_ERROR_INVALID_PARAMETER;
926 int ret = CAMERA_ERROR_NONE;
928 camera_cli_s *pc = (camera_cli_s *)camera;
929 muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
931 int is_capturing_cb = 0;
932 int is_completed_cb = 0;
933 LOGD("Enter, handle :%x", pc->remote_handle);
935 if (pc->cb_info == NULL) {
936 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
937 return CAMERA_ERROR_INVALID_PARAMETER;
940 sock_fd = pc->cb_info->fd;
942 if (capturing_cb != NULL) {
944 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
945 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
948 if(completed_cb != NULL) {
950 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
951 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
954 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, is_capturing_cb, INT, is_completed_cb);
955 LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
956 LOGD("ret : 0x%x", ret);
960 bool camera_is_supported_continuous_capture(camera_h camera)
962 if (camera == NULL) {
963 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
967 int ret = CAMERA_ERROR_NONE;
968 camera_cli_s *pc = (camera_cli_s *)camera;
969 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
972 if (pc->cb_info == NULL) {
973 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
974 return CAMERA_ERROR_INVALID_PARAMETER;
977 sock_fd = pc->cb_info->fd;
979 LOGD("Enter, remote_handle : %x", pc->remote_handle);
980 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
981 LOGD("ret : 0x%x", ret);
985 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)
987 if (camera == NULL) {
988 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
989 return CAMERA_ERROR_INVALID_PARAMETER;
992 int ret = CAMERA_ERROR_NONE;
994 camera_cli_s *pc = (camera_cli_s *)camera;
995 muse_camera_api_e api = MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE;
997 LOGD("Enter, handle :%x", pc->remote_handle);
1000 if (pc->cb_info == NULL) {
1001 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1002 return CAMERA_ERROR_INVALID_PARAMETER;
1004 sock_fd = pc->cb_info->fd;
1006 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
1007 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
1008 pc->cb_info->user_cb_completed[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = completed_cb;
1010 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, count, INT, interval);
1011 LOGD("ret : 0x%x", ret);
1015 int camera_stop_continuous_capture(camera_h camera)
1017 if (camera == NULL) {
1018 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1019 return CAMERA_ERROR_INVALID_PARAMETER;
1023 int ret = CAMERA_ERROR_NONE;
1025 camera_cli_s *pc = (camera_cli_s *)camera;
1026 muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
1027 LOGD("Enter, handle :%x", pc->remote_handle);
1029 if (pc->cb_info == NULL) {
1030 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1031 return CAMERA_ERROR_INVALID_PARAMETER;
1033 sock_fd = pc->cb_info->fd;
1034 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1035 LOGD("ret : 0x%x", ret);
1039 bool camera_is_supported_face_detection(camera_h camera)
1041 if (camera == NULL) {
1042 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1045 int ret = CAMERA_ERROR_NONE;
1047 camera_cli_s *pc = (camera_cli_s *)camera;
1048 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
1050 if (pc->cb_info == NULL) {
1051 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1052 return CAMERA_ERROR_INVALID_PARAMETER;
1054 sock_fd = pc->cb_info->fd;
1056 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1057 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1058 LOGD("ret : 0x%x", ret);
1062 bool camera_is_supported_zero_shutter_lag(camera_h camera)
1064 if (camera == NULL) {
1065 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1068 int ret = CAMERA_ERROR_NONE;
1070 camera_cli_s *pc = (camera_cli_s *)camera;
1071 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
1073 if (pc->cb_info == NULL) {
1074 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1075 return CAMERA_ERROR_INVALID_PARAMETER;
1077 sock_fd = pc->cb_info->fd;
1079 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1080 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1081 LOGD("ret : 0x%x", ret);
1085 bool camera_is_supported_media_packet_preview_cb(camera_h camera)
1087 if (camera == NULL) {
1088 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1092 int ret = CAMERA_ERROR_NONE;
1094 camera_cli_s *pc = (camera_cli_s *)camera;
1095 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
1097 if (pc->cb_info == NULL) {
1098 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1099 return CAMERA_ERROR_INVALID_PARAMETER;
1101 sock_fd = pc->cb_info->fd;
1103 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1104 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1105 LOGD("ret : 0x%x", ret);
1109 int camera_get_device_count(camera_h camera, int *device_count)
1111 if (camera == NULL || device_count == NULL) {
1112 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1113 return CAMERA_ERROR_INVALID_PARAMETER;
1115 int ret = CAMERA_ERROR_NONE;
1117 camera_cli_s *pc = (camera_cli_s *)camera;
1118 muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
1120 if (pc->cb_info == NULL) {
1121 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1122 return CAMERA_ERROR_INVALID_PARAMETER;
1124 sock_fd = pc->cb_info->fd;
1125 int get_device_count;
1127 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1128 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1130 if (ret == CAMERA_ERROR_NONE) {
1131 muse_camera_msg_get(get_device_count, pc->cb_info->recvMsg);
1132 *device_count = get_device_count;
1134 LOGD("ret : 0x%x", ret);
1138 int camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data)
1140 if (camera == NULL) {
1141 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1142 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_START_FACE_DETECTION;
1150 LOGD("Enter, handle :%x", pc->remote_handle);
1152 if (pc->cb_info == NULL) {
1153 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1154 return CAMERA_ERROR_INVALID_PARAMETER;
1156 sock_fd = pc->cb_info->fd;
1157 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = callback;
1158 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = user_data;
1160 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1161 LOGD("ret : 0x%x", ret);
1165 int camera_stop_face_detection(camera_h camera)
1167 if (camera == NULL) {
1168 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1169 return CAMERA_ERROR_INVALID_PARAMETER;
1172 int ret = CAMERA_ERROR_NONE;
1174 camera_cli_s *pc = (camera_cli_s *)camera;
1175 muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
1176 LOGD("Enter, handle :%x", pc->remote_handle);
1178 if (pc->cb_info == NULL) {
1179 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1180 return CAMERA_ERROR_INVALID_PARAMETER;
1182 sock_fd = pc->cb_info->fd;
1183 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1184 LOGD("ret : 0x%x", ret);
1188 int camera_get_state(camera_h camera, camera_state_e * state)
1190 if (camera == NULL || state == NULL) {
1191 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1192 return CAMERA_ERROR_INVALID_PARAMETER;
1194 int ret = CAMERA_ERROR_NONE;
1196 camera_cli_s *pc = (camera_cli_s *)camera;
1197 muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
1199 if (pc->cb_info == NULL) {
1200 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1201 return CAMERA_ERROR_INVALID_PARAMETER;
1203 sock_fd = pc->cb_info->fd;
1206 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1207 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1209 if (ret == CAMERA_ERROR_NONE) {
1210 muse_camera_msg_get(get_state, pc->cb_info->recvMsg);
1211 *state = (camera_state_e)get_state;
1213 LOGD("ret : 0x%x", ret);
1217 int camera_start_focusing(camera_h camera, bool continuous)
1219 if( camera == NULL){
1220 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1221 return CAMERA_ERROR_INVALID_PARAMETER;
1224 int ret = CAMERA_ERROR_NONE;
1226 camera_cli_s *pc = (camera_cli_s *)camera;
1227 muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
1229 if (pc->cb_info == NULL) {
1230 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1231 return CAMERA_ERROR_INVALID_PARAMETER;
1233 sock_fd = pc->cb_info->fd;
1234 int is_continuous = (int)continuous;
1236 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1237 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, is_continuous);
1238 LOGD("ret : 0x%x", ret);
1242 int camera_cancel_focusing(camera_h camera)
1244 if (camera == NULL) {
1245 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1246 return CAMERA_ERROR_INVALID_PARAMETER;
1249 int ret = CAMERA_ERROR_NONE;
1251 camera_cli_s *pc = (camera_cli_s *)camera;
1252 muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
1254 if (pc->cb_info == NULL) {
1255 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1256 return CAMERA_ERROR_INVALID_PARAMETER;
1258 sock_fd = pc->cb_info->fd;
1260 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1261 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1262 LOGD("ret : 0x%x", ret);
1266 int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
1268 int ret = CAMERA_ERROR_NONE;
1269 int display_surface;
1270 void *set_display_handle = NULL;
1271 int set_surface = MM_DISPLAY_SURFACE_X;
1272 Evas_Object *obj = NULL;
1273 const char *object_type = NULL;
1274 char socket_path[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
1276 if (camera == NULL) {
1277 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1278 return CAMERA_ERROR_INVALID_PARAMETER;
1281 if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
1282 LOGE("display type[%d] is not NONE, but display handle is NULL", type);
1283 return CAMERA_ERROR_INVALID_PARAMETER;
1286 int display_type = (int)type;
1287 camera_cli_s *pc = (camera_cli_s *)camera;
1288 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
1290 if (pc->cb_info == NULL) {
1291 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1292 return CAMERA_ERROR_INVALID_PARAMETER;
1294 sock_fd = pc->cb_info->fd;
1296 LOGD("Enter, remote_handle : %x display : 0x%x", pc->remote_handle, display);
1298 if (type == CAMERA_DISPLAY_TYPE_NONE) {
1299 set_display_handle = 0;
1300 set_surface = MM_DISPLAY_SURFACE_NULL;
1301 LOGD("display type NONE");
1303 obj = (Evas_Object *)display;
1304 object_type = evas_object_type_get(obj);
1306 if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1308 MMCamWaylandInfo *wl_info = g_new0(MMCamWaylandInfo, 1);
1310 if (wl_info == NULL) {
1311 LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
1312 return CAMERA_ERROR_OUT_OF_MEMORY;
1315 wl_info->evas_obj = (void *)obj;
1316 wl_info->window = (void *)elm_win_wl_window_get(obj);
1317 wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
1318 wl_info->display = (void *)ecore_wl_display_get();
1320 if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
1321 LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
1322 return CAMERA_ERROR_INVALID_OPERATION;
1325 evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
1326 &wl_info->window_width, &wl_info->window_height);
1328 /* set wayland info */
1329 pc->wl_info = wl_info;
1330 set_surface = MM_DISPLAY_SURFACE_X;
1331 set_display_handle = (void *)wl_info;
1333 LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
1334 wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
1335 wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
1336 #else /* HAVE_WAYLAND */
1337 /* x window overlay surface */
1338 set_display_handle = (void *)elm_win_xwindow_get(obj);
1339 set_surface = MM_DISPLAY_SURFACE_X;
1340 LOGD("display type OVERLAY : handle %p", set_display_handle);
1342 } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
1343 /* evas object surface */
1344 set_display_handle = (void *)display;
1345 set_surface = MM_DISPLAY_SURFACE_EVAS;
1346 LOGD("display type EVAS : handle %p", set_display_handle);
1348 LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
1349 return CAMERA_ERROR_INVALID_PARAMETER;
1352 LOGE("failed to get evas object type from %p", obj);
1353 return CAMERA_ERROR_INVALID_PARAMETER;
1357 pc->cli_display_handle = (intptr_t)set_display_handle;
1358 display_surface = (int)set_surface;
1359 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret,
1361 INT, display_surface);
1363 if (ret == CAMERA_ERROR_NONE && type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1364 if (mm_camcorder_client_create(&(pc->client_handle))) {
1365 LOGE("camera client create Failed");
1366 return CAMERA_ERROR_INVALID_OPERATION;
1368 muse_camera_msg_get_string(socket_path, pc->cb_info->recvMsg);
1369 LOGD("shmsrc stream path : %s", socket_path);
1370 if(mm_camcorder_client_set_shm_socket_path(pc->client_handle, socket_path)
1372 return CAMERA_ERROR_INVALID_OPERATION;
1373 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1374 MMCAM_DISPLAY_SURFACE, set_surface,
1376 if (ret == MM_ERROR_NONE && type != CAMERA_DISPLAY_TYPE_NONE) {
1377 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1378 MMCAM_DISPLAY_HANDLE, pc->cli_display_handle, sizeof(void *),
1380 LOGD("ret : 0x%x", ret);
1383 LOGD("ret : 0x%x", ret);
1387 int camera_set_preview_resolution(camera_h camera, int width, int height)
1389 if( camera == NULL){
1390 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1391 return CAMERA_ERROR_INVALID_PARAMETER;
1393 int ret = CAMERA_ERROR_NONE;
1395 camera_cli_s *pc = (camera_cli_s *)camera;
1396 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
1398 if (pc->cb_info == NULL) {
1399 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1400 return CAMERA_ERROR_INVALID_PARAMETER;
1402 sock_fd = pc->cb_info->fd;
1404 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1405 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1406 LOGD("ret : 0x%x", ret);
1411 int camera_set_capture_resolution(camera_h camera, int width, int height)
1413 if (camera == NULL) {
1414 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1415 return CAMERA_ERROR_INVALID_PARAMETER;
1418 int ret = CAMERA_ERROR_NONE;
1420 camera_cli_s *pc = (camera_cli_s *)camera;
1421 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
1423 if (pc->cb_info == NULL) {
1424 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1425 return CAMERA_ERROR_INVALID_PARAMETER;
1427 sock_fd = pc->cb_info->fd;
1429 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1430 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1431 LOGD("ret : 0x%x", ret);
1435 int camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
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_format = (int)format;
1445 camera_cli_s *pc = (camera_cli_s *)camera;
1446 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
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, capture_format: %d", pc->remote_handle, set_format);
1455 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1456 LOGD("ret : 0x%x", ret);
1460 int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
1462 if (camera == NULL) {
1463 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1464 return CAMERA_ERROR_INVALID_PARAMETER;
1467 int ret = CAMERA_ERROR_NONE;
1468 int set_format = (int)format;
1470 camera_cli_s *pc = (camera_cli_s *)camera;
1471 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
1473 if (pc->cb_info == NULL) {
1474 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1475 return CAMERA_ERROR_INVALID_PARAMETER;
1477 sock_fd = pc->cb_info->fd;
1479 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1480 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1481 LOGD("ret : 0x%x", ret);
1485 int camera_get_preview_resolution(camera_h camera, int *width, int *height)
1487 if (camera == NULL || width == NULL || height == NULL) {
1488 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1489 return CAMERA_ERROR_INVALID_PARAMETER;
1493 int ret = CAMERA_ERROR_NONE;
1495 camera_cli_s *pc = (camera_cli_s *)camera;
1496 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
1498 if (pc->cb_info == NULL) {
1499 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1500 return CAMERA_ERROR_INVALID_PARAMETER;
1502 sock_fd = pc->cb_info->fd;
1506 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1507 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1509 if (ret == CAMERA_ERROR_NONE) {
1510 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1511 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1513 *height = get_height;
1515 LOGD("ret : 0x%x", ret);
1519 int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
1521 if( camera == NULL){
1522 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1523 return CAMERA_ERROR_INVALID_PARAMETER;
1526 int ret = CAMERA_ERROR_NONE;
1527 camera_cli_s *pc = (camera_cli_s *)camera;
1528 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
1530 if (pc->cb_info == NULL) {
1531 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1532 return CAMERA_ERROR_INVALID_PARAMETER;
1534 sock_fd = pc->cb_info->fd;
1535 int set_rotation = (int)rotation;
1537 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1538 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
1539 LOGD("ret : 0x%x", ret);
1543 int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
1545 if( camera == NULL || rotation == NULL ){
1546 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1547 return CAMERA_ERROR_INVALID_PARAMETER;
1550 int ret = CAMERA_ERROR_NONE;
1552 camera_cli_s *pc = (camera_cli_s *)camera;
1553 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
1555 if (pc->cb_info == NULL) {
1556 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1557 return CAMERA_ERROR_INVALID_PARAMETER;
1559 sock_fd = pc->cb_info->fd;
1562 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1563 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1565 if (ret == CAMERA_ERROR_NONE) {
1566 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
1567 *rotation = (camera_rotation_e)get_rotation;
1569 LOGD("ret : 0x%x", ret);
1573 int camera_set_display_flip(camera_h camera, camera_flip_e flip)
1575 if( camera == NULL){
1576 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1577 return CAMERA_ERROR_INVALID_PARAMETER;
1580 int ret = CAMERA_ERROR_NONE;
1582 camera_cli_s *pc = (camera_cli_s *)camera;
1583 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
1585 if (pc->cb_info == NULL) {
1586 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1587 return CAMERA_ERROR_INVALID_PARAMETER;
1589 sock_fd = pc->cb_info->fd;
1590 int set_flip = (int)flip;
1592 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1593 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
1594 LOGD("ret : 0x%x", ret);
1598 int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
1600 if( camera == NULL || flip == NULL ){
1601 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1602 return CAMERA_ERROR_INVALID_PARAMETER;
1605 int ret = CAMERA_ERROR_NONE;
1607 camera_cli_s *pc = (camera_cli_s *)camera;
1608 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
1610 if (pc->cb_info == NULL) {
1611 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1612 return CAMERA_ERROR_INVALID_PARAMETER;
1614 sock_fd = pc->cb_info->fd;
1617 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1618 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1620 if (ret == CAMERA_ERROR_NONE) {
1621 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
1622 *flip = (camera_flip_e)get_flip;
1624 LOGD("ret : 0x%x", ret);
1628 int camera_set_display_visible(camera_h camera, bool visible)
1630 if( camera == NULL){
1631 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1632 return CAMERA_ERROR_INVALID_PARAMETER;
1635 int ret = CAMERA_ERROR_NONE;
1637 camera_cli_s *pc = (camera_cli_s *)camera;
1638 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
1639 int set_visible = (int)visible;
1641 if (pc->cb_info == NULL) {
1642 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1643 return CAMERA_ERROR_INVALID_PARAMETER;
1645 sock_fd = pc->cb_info->fd;
1647 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1648 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_visible);
1649 LOGD("ret : 0x%x", ret);
1653 int camera_is_display_visible(camera_h camera, bool* visible)
1655 if( camera == NULL || visible == NULL){
1656 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1657 return CAMERA_ERROR_INVALID_PARAMETER;
1660 int ret = CAMERA_ERROR_NONE;
1662 camera_cli_s *pc = (camera_cli_s *)camera;
1663 muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
1665 if (pc->cb_info == NULL) {
1666 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1667 return CAMERA_ERROR_INVALID_PARAMETER;
1669 sock_fd = pc->cb_info->fd;
1672 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1673 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1675 if (ret == CAMERA_ERROR_NONE) {
1676 muse_camera_msg_get(get_visible, pc->cb_info->recvMsg);
1677 *visible = (bool)get_visible;
1679 LOGD("ret : 0x%x", ret);
1683 int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
1685 if (camera == NULL) {
1686 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1687 return CAMERA_ERROR_INVALID_PARAMETER;
1690 int ret = CAMERA_ERROR_NONE;
1691 int set_mode = (int)mode;
1693 camera_cli_s *pc = (camera_cli_s *)camera;
1694 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
1696 if (pc->cb_info == NULL) {
1697 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1698 return CAMERA_ERROR_INVALID_PARAMETER;
1700 sock_fd = pc->cb_info->fd;
1702 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1703 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
1704 LOGD("ret : 0x%x", ret);
1708 int camera_get_display_mode(camera_h camera, camera_display_mode_e* mode)
1710 if( camera == NULL || mode == NULL){
1711 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1712 return CAMERA_ERROR_INVALID_PARAMETER;
1715 int ret = CAMERA_ERROR_NONE;
1717 camera_cli_s *pc = (camera_cli_s *)camera;
1718 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
1720 if (pc->cb_info == NULL) {
1721 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1722 return CAMERA_ERROR_INVALID_PARAMETER;
1724 sock_fd = pc->cb_info->fd;
1727 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1728 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1730 if (ret == CAMERA_ERROR_NONE) {
1731 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
1732 *mode = (camera_display_mode_e)get_mode;
1734 LOGD("ret : 0x%x", ret);
1738 int camera_get_capture_resolution(camera_h camera, int *width, int *height)
1740 if( camera == NULL || width== NULL || height == NULL){
1741 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1742 return CAMERA_ERROR_INVALID_PARAMETER;
1744 int ret = CAMERA_ERROR_NONE;
1746 camera_cli_s *pc = (camera_cli_s *)camera;
1747 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
1749 if (pc->cb_info == NULL) {
1750 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1751 return CAMERA_ERROR_INVALID_PARAMETER;
1753 sock_fd = pc->cb_info->fd;
1757 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1758 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1760 if (ret == CAMERA_ERROR_NONE) {
1761 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1762 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1764 *height = get_height;
1766 LOGD("ret : 0x%x", ret);
1770 int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
1772 if( camera == NULL || format == NULL){
1773 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1774 return CAMERA_ERROR_INVALID_PARAMETER;
1776 int ret = CAMERA_ERROR_NONE;
1778 camera_cli_s *pc = (camera_cli_s *)camera;
1779 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
1782 if (pc->cb_info == NULL) {
1783 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1784 return CAMERA_ERROR_INVALID_PARAMETER;
1786 sock_fd = pc->cb_info->fd;
1788 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1789 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1791 if (ret == CAMERA_ERROR_NONE) {
1792 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1793 *format = (camera_pixel_format_e)get_format;
1795 LOGD("ret : 0x%x", ret);
1799 int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
1801 if( camera == NULL || format == NULL){
1802 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1803 return CAMERA_ERROR_INVALID_PARAMETER;
1806 int ret = CAMERA_ERROR_NONE;
1808 camera_cli_s *pc = (camera_cli_s *)camera;
1809 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
1812 if (pc->cb_info == NULL) {
1813 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1814 return CAMERA_ERROR_INVALID_PARAMETER;
1816 sock_fd = pc->cb_info->fd;
1818 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1819 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1821 if (ret == CAMERA_ERROR_NONE) {
1822 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1823 *format = (camera_pixel_format_e)get_format;
1825 LOGD("ret : 0x%x", ret);
1829 int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void* user_data)
1831 if (camera == NULL || callback == NULL) {
1832 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1833 return CAMERA_ERROR_INVALID_PARAMETER;
1835 int ret = CAMERA_ERROR_NONE;
1837 camera_cli_s *pc = (camera_cli_s *)camera;
1839 if (pc->cb_info == NULL) {
1840 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1841 return CAMERA_ERROR_INVALID_PARAMETER;
1843 sock_fd = pc->cb_info->fd;
1844 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
1846 LOGD("Enter, handle :%x", pc->remote_handle);
1848 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = callback;
1849 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = user_data;
1851 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1852 LOGD("ret : 0x%x", ret);
1856 int camera_unset_preview_cb(camera_h camera)
1858 if (camera == NULL) {
1859 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1860 return CAMERA_ERROR_INVALID_PARAMETER;
1863 int ret = CAMERA_ERROR_NONE;
1865 camera_cli_s *pc = (camera_cli_s *)camera;
1866 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
1868 LOGD("Enter, handle :%x", pc->remote_handle);
1871 if (pc->cb_info == NULL) {
1872 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1873 return CAMERA_ERROR_INVALID_PARAMETER;
1875 sock_fd = pc->cb_info->fd;
1876 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1877 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1879 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1880 LOGD("ret : 0x%x", ret);
1884 int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void* user_data)
1886 if (camera == NULL) {
1887 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
1888 return CAMERA_ERROR_INVALID_PARAMETER;
1891 if (callback == NULL) {
1892 LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
1893 return CAMERA_ERROR_NOT_SUPPORTED;
1896 int ret = CAMERA_ERROR_NONE;
1898 camera_cli_s *pc = (camera_cli_s *)camera;
1899 muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
1901 LOGD("Enter, handle :%x", pc->remote_handle);
1904 if (pc->cb_info == NULL) {
1905 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1906 return CAMERA_ERROR_INVALID_PARAMETER;
1908 sock_fd = pc->cb_info->fd;
1909 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = callback;
1910 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = user_data;
1912 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1913 LOGD("ret : 0x%x", ret);
1917 int camera_unset_media_packet_preview_cb(camera_h camera)
1919 if (camera == NULL) {
1920 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1921 return CAMERA_ERROR_INVALID_PARAMETER;
1924 int ret = CAMERA_ERROR_NONE;
1926 camera_cli_s *pc = (camera_cli_s *)camera;
1927 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
1929 LOGD("Enter, handle :%x", pc->remote_handle);
1932 if (pc->cb_info == NULL) {
1933 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1934 return CAMERA_ERROR_INVALID_PARAMETER;
1936 sock_fd = pc->cb_info->fd;
1937 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1938 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1940 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1941 LOGD("ret : 0x%x", ret);
1945 int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void* user_data)
1947 if( camera == NULL || callback == NULL){
1948 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1949 return CAMERA_ERROR_INVALID_PARAMETER;
1951 int ret = CAMERA_ERROR_NONE;
1953 camera_cli_s *pc = (camera_cli_s *)camera;
1954 muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
1956 LOGD("Enter, handle :%x", pc->remote_handle);
1959 if (pc->cb_info == NULL) {
1960 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1961 return CAMERA_ERROR_INVALID_PARAMETER;
1963 sock_fd = pc->cb_info->fd;
1964 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = callback;
1965 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = user_data;
1967 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1968 LOGD("ret : 0x%x", ret);
1971 int camera_unset_state_changed_cb(camera_h camera)
1973 if( camera == NULL){
1974 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1975 return CAMERA_ERROR_INVALID_PARAMETER;
1977 int ret = CAMERA_ERROR_NONE;
1979 camera_cli_s *pc = (camera_cli_s *)camera;
1980 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
1982 LOGD("Enter, handle :%x", pc->remote_handle);
1985 if (pc->cb_info == NULL) {
1986 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1987 return CAMERA_ERROR_INVALID_PARAMETER;
1989 sock_fd = pc->cb_info->fd;
1990 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1991 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1993 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1994 LOGD("ret : 0x%x", ret);
1998 int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
2000 if( camera == NULL || callback == NULL){
2001 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2002 return CAMERA_ERROR_INVALID_PARAMETER;
2004 int ret = CAMERA_ERROR_NONE;
2006 camera_cli_s *pc = (camera_cli_s *)camera;
2007 muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
2009 LOGD("Enter, handle :%x", pc->remote_handle);
2012 if (pc->cb_info == NULL) {
2013 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2014 return CAMERA_ERROR_INVALID_PARAMETER;
2016 sock_fd = pc->cb_info->fd;
2017 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = callback;
2018 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = user_data;
2020 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2021 LOGD("ret : 0x%x", ret);
2025 int camera_unset_interrupted_cb(camera_h camera)
2027 if( camera == NULL){
2028 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2029 return CAMERA_ERROR_INVALID_PARAMETER;
2031 int ret = CAMERA_ERROR_NONE;
2033 camera_cli_s *pc = (camera_cli_s *)camera;
2034 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
2036 LOGD("Enter, handle :%x", pc->remote_handle);
2039 if (pc->cb_info == NULL) {
2040 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2041 return CAMERA_ERROR_INVALID_PARAMETER;
2043 sock_fd = pc->cb_info->fd;
2044 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
2045 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
2047 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2048 LOGD("ret : 0x%x", ret);
2052 int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void* user_data)
2054 if( camera == NULL || callback == NULL){
2055 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2056 return CAMERA_ERROR_INVALID_PARAMETER;
2058 int ret = CAMERA_ERROR_NONE;
2060 camera_cli_s *pc = (camera_cli_s *)camera;
2061 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
2063 LOGD("Enter, handle :%x", pc->remote_handle);
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;
2071 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = callback;
2072 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = user_data;
2074 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2075 LOGD("ret : 0x%x", ret);
2079 int camera_unset_focus_changed_cb(camera_h camera)
2081 if( camera == NULL){
2082 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2083 return CAMERA_ERROR_INVALID_PARAMETER;
2085 int ret = CAMERA_ERROR_NONE;
2087 camera_cli_s *pc = (camera_cli_s *)camera;
2088 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
2090 LOGD("Enter, handle :%x", pc->remote_handle);
2093 if (pc->cb_info == NULL) {
2094 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2095 return CAMERA_ERROR_INVALID_PARAMETER;
2097 sock_fd = pc->cb_info->fd;
2098 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
2099 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
2101 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2102 LOGD("ret : 0x%x", ret);
2106 int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
2108 if( camera == NULL || callback == NULL){
2109 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2110 return CAMERA_ERROR_INVALID_PARAMETER;
2112 int ret = CAMERA_ERROR_NONE;
2114 camera_cli_s *pc = (camera_cli_s *)camera;
2115 muse_camera_api_e api = MUSE_CAMERA_API_SET_ERROR_CB;
2117 LOGD("Enter, handle :%x", pc->remote_handle);
2120 if (pc->cb_info == NULL) {
2121 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2122 return CAMERA_ERROR_INVALID_PARAMETER;
2124 sock_fd = pc->cb_info->fd;
2125 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = callback;
2126 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = user_data;
2128 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2129 LOGD("ret : 0x%x", ret);
2133 int camera_unset_error_cb(camera_h camera)
2135 if( camera == NULL){
2136 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2137 return CAMERA_ERROR_INVALID_PARAMETER;
2139 int ret = CAMERA_ERROR_NONE;
2141 camera_cli_s *pc = (camera_cli_s *)camera;
2142 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
2144 LOGD("Enter, handle :%x", pc->remote_handle);
2147 if (pc->cb_info == NULL) {
2148 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2149 return CAMERA_ERROR_INVALID_PARAMETER;
2151 sock_fd = pc->cb_info->fd;
2152 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
2153 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
2155 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2156 LOGD("ret : 0x%x", ret);
2160 int camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb , void *user_data)
2162 if( camera == NULL || foreach_cb == NULL){
2163 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2164 return CAMERA_ERROR_INVALID_PARAMETER;
2166 int ret = CAMERA_ERROR_NONE;
2168 camera_cli_s *pc = (camera_cli_s *)camera;
2169 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
2171 LOGD("Enter, handle :%x", pc->remote_handle);
2174 if (pc->cb_info == NULL) {
2175 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2176 return CAMERA_ERROR_INVALID_PARAMETER;
2178 sock_fd = pc->cb_info->fd;
2179 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
2180 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
2182 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2183 LOGD("ret : 0x%x", ret);
2187 int camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb , void *user_data)
2189 if( camera == NULL || foreach_cb == NULL){
2190 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2191 return CAMERA_ERROR_INVALID_PARAMETER;
2193 int ret = CAMERA_ERROR_NONE;
2195 camera_cli_s *pc = (camera_cli_s *)camera;
2196 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
2198 LOGD("Enter, handle :%x", pc->remote_handle);
2201 if (pc->cb_info == NULL) {
2202 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2203 return CAMERA_ERROR_INVALID_PARAMETER;
2205 sock_fd = pc->cb_info->fd;
2206 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
2207 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
2209 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2210 LOGD("ret : 0x%x", ret);
2214 int camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb , void *user_data)
2216 if( camera == NULL || foreach_cb == NULL){
2217 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2218 return CAMERA_ERROR_INVALID_PARAMETER;
2220 int ret = CAMERA_ERROR_NONE;
2222 camera_cli_s *pc = (camera_cli_s *)camera;
2223 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
2225 LOGD("Enter, handle :%x", pc->remote_handle);
2228 if (pc->cb_info == NULL) {
2229 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2230 return CAMERA_ERROR_INVALID_PARAMETER;
2232 sock_fd = pc->cb_info->fd;
2233 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
2234 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
2236 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2237 LOGD("ret : 0x%x", ret);
2242 int camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb , void *user_data)
2244 if( camera == NULL || foreach_cb == NULL){
2245 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2246 return CAMERA_ERROR_INVALID_PARAMETER;
2248 int ret = CAMERA_ERROR_NONE;
2250 camera_cli_s *pc = (camera_cli_s *)camera;
2251 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
2253 LOGD("Enter, handle :%x", pc->remote_handle);
2256 if (pc->cb_info == NULL) {
2257 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2258 return CAMERA_ERROR_INVALID_PARAMETER;
2260 sock_fd = pc->cb_info->fd;
2261 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
2262 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
2264 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2265 LOGD("ret : 0x%x", ret);
2270 int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
2272 if (camera == NULL || width == NULL || height == NULL) {
2273 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2274 return CAMERA_ERROR_INVALID_PARAMETER;
2276 int ret = CAMERA_ERROR_NONE;
2278 camera_cli_s *pc = (camera_cli_s *)camera;
2279 muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
2281 if (pc->cb_info == NULL) {
2282 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2283 return CAMERA_ERROR_INVALID_PARAMETER;
2285 sock_fd = pc->cb_info->fd;
2289 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2290 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2292 if (ret == CAMERA_ERROR_NONE) {
2293 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2294 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2296 *height = get_height;
2298 LOGD("ret : 0x%x", ret);
2303 int camera_attr_get_lens_orientation(camera_h camera, int *angle)
2305 if( camera == NULL || angle == NULL){
2306 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2307 return CAMERA_ERROR_INVALID_PARAMETER;
2309 int ret = CAMERA_ERROR_NONE;
2311 camera_cli_s *pc = (camera_cli_s *)camera;
2312 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
2314 if (pc->cb_info == NULL) {
2315 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2316 return CAMERA_ERROR_INVALID_PARAMETER;
2318 sock_fd = pc->cb_info->fd;
2321 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2322 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2324 if (ret == CAMERA_ERROR_NONE) {
2325 muse_camera_msg_get(get_angle, pc->cb_info->recvMsg);
2328 LOGD("ret : 0x%x", ret);
2332 int camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
2334 if (camera == NULL) {
2335 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2336 return CAMERA_ERROR_INVALID_PARAMETER;
2338 int ret = CAMERA_ERROR_NONE;
2339 camera_cli_s *pc = (camera_cli_s *)camera;
2340 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
2342 if (pc->cb_info == NULL) {
2343 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2344 return CAMERA_ERROR_INVALID_PARAMETER;
2346 sock_fd = pc->cb_info->fd;
2347 int set_mode = (int)mode;
2348 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2349 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2350 LOGD("ret : 0x%x", ret);
2354 int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
2356 if (camera == NULL || mode == NULL) {
2357 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2358 return CAMERA_ERROR_INVALID_PARAMETER;
2361 int ret = CAMERA_ERROR_NONE;
2362 camera_cli_s *pc = (camera_cli_s *)camera;
2363 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
2365 if (pc->cb_info == NULL) {
2366 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2367 return CAMERA_ERROR_INVALID_PARAMETER;
2369 sock_fd = pc->cb_info->fd;
2371 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2372 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2374 if (ret == CAMERA_ERROR_NONE) {
2375 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2376 *mode = (camera_attr_theater_mode_e)get_mode;
2378 LOGD("ret : 0x%x", ret);
2382 int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
2384 if (camera == NULL || foreach_cb == 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_FOREACH_SUPPORTED_THEATER_MODE;
2393 LOGD("Enter, handle :%x", pc->remote_handle);
2396 if (pc->cb_info == NULL) {
2397 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2398 return CAMERA_ERROR_INVALID_PARAMETER;
2400 sock_fd = pc->cb_info->fd;
2401 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
2402 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
2404 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2406 LOGD("Finish, return :%x", ret);
2411 int camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
2413 if( camera == NULL){
2414 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2415 return CAMERA_ERROR_INVALID_PARAMETER;
2417 int ret = CAMERA_ERROR_NONE;
2418 camera_cli_s *pc = (camera_cli_s *)camera;
2419 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
2421 if (pc->cb_info == NULL) {
2422 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2423 return CAMERA_ERROR_INVALID_PARAMETER;
2425 sock_fd = pc->cb_info->fd;
2426 int set_fps = (int)fps;
2427 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2428 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_fps);
2429 LOGD("ret : 0x%x", ret);
2434 int camera_attr_set_image_quality(camera_h camera, int quality)
2436 if( camera == NULL){
2437 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2438 return CAMERA_ERROR_INVALID_PARAMETER;
2440 int ret = CAMERA_ERROR_NONE;
2442 camera_cli_s *pc = (camera_cli_s *)camera;
2443 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
2445 if (pc->cb_info == NULL) {
2446 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2447 return CAMERA_ERROR_INVALID_PARAMETER;
2449 sock_fd = pc->cb_info->fd;
2450 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2451 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, quality);
2452 LOGD("ret : 0x%x", ret);
2456 int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
2458 if( camera == NULL || fps == NULL){
2459 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2460 return CAMERA_ERROR_INVALID_PARAMETER;
2462 int ret = CAMERA_ERROR_NONE;
2464 camera_cli_s *pc = (camera_cli_s *)camera;
2465 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
2468 if (pc->cb_info == NULL) {
2469 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2470 return CAMERA_ERROR_INVALID_PARAMETER;
2472 sock_fd = pc->cb_info->fd;
2474 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2475 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2477 if (ret == CAMERA_ERROR_NONE) {
2478 muse_camera_msg_get(get_fps, pc->cb_info->recvMsg);
2479 *fps = (camera_attr_fps_e)get_fps;
2481 LOGD("ret : 0x%x", ret);
2486 int camera_attr_get_image_quality(camera_h camera, int *quality)
2488 if( camera == NULL || quality == NULL){
2489 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2490 return CAMERA_ERROR_INVALID_PARAMETER;
2492 int ret = CAMERA_ERROR_NONE;
2494 camera_cli_s *pc = (camera_cli_s *)camera;
2495 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
2497 if (pc->cb_info == NULL) {
2498 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2499 return CAMERA_ERROR_INVALID_PARAMETER;
2501 sock_fd = pc->cb_info->fd;
2503 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2504 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2506 if (ret == CAMERA_ERROR_NONE) {
2507 muse_camera_msg_get(get_quality, pc->cb_info->recvMsg);
2508 *quality = get_quality;
2510 LOGD("ret : 0x%x", ret);
2515 int camera_attr_set_zoom(camera_h camera, int zoom)
2517 if( camera == NULL){
2518 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2519 return CAMERA_ERROR_INVALID_PARAMETER;
2521 int ret = CAMERA_ERROR_NONE;
2523 camera_cli_s *pc = (camera_cli_s *)camera;
2524 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
2526 if (pc->cb_info == NULL) {
2527 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2528 return CAMERA_ERROR_INVALID_PARAMETER;
2530 sock_fd = pc->cb_info->fd;
2532 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2533 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, zoom);
2534 LOGD("ret : 0x%x", ret);
2538 int camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
2540 if( camera == NULL){
2541 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2542 return CAMERA_ERROR_INVALID_PARAMETER;
2544 int ret = CAMERA_ERROR_NONE;
2546 camera_cli_s *pc = (camera_cli_s *)camera;
2547 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
2549 if (pc->cb_info == NULL) {
2550 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2551 return CAMERA_ERROR_INVALID_PARAMETER;
2553 sock_fd = pc->cb_info->fd;
2554 int set_mode = (int)mode;
2555 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2556 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2557 LOGD("ret : 0x%x", ret);
2561 int camera_attr_set_af_area(camera_h camera, int x, int y)
2563 if( camera == NULL){
2564 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2565 return CAMERA_ERROR_INVALID_PARAMETER;
2567 int ret = CAMERA_ERROR_NONE;
2568 camera_cli_s *pc = (camera_cli_s *)camera;
2569 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
2570 int sock_fd = pc->cb_info->fd;
2571 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2572 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, x, INT, y);
2573 LOGD("ret : 0x%x", ret);
2578 int camera_attr_clear_af_area(camera_h camera)
2580 if( camera == NULL){
2581 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2582 return CAMERA_ERROR_INVALID_PARAMETER;
2584 int ret = CAMERA_ERROR_NONE;
2586 camera_cli_s *pc = (camera_cli_s *)camera;
2587 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA;
2589 if (pc->cb_info == NULL) {
2590 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2591 return CAMERA_ERROR_INVALID_PARAMETER;
2593 sock_fd = pc->cb_info->fd;
2594 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2595 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2596 LOGD("ret : 0x%x", ret);
2601 int camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode)
2603 if( camera == NULL){
2604 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2605 return CAMERA_ERROR_INVALID_PARAMETER;
2608 if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
2609 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
2610 return CAMERA_ERROR_NOT_SUPPORTED;
2613 int ret = CAMERA_ERROR_NONE;
2614 camera_cli_s *pc = (camera_cli_s *)camera;
2615 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
2616 int set_mode = (int)mode;
2618 if (pc->cb_info == NULL) {
2619 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2620 return CAMERA_ERROR_INVALID_PARAMETER;
2622 sock_fd = pc->cb_info->fd;
2623 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2624 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2625 LOGD("ret : 0x%x", ret);
2630 int camera_attr_set_exposure(camera_h camera, int value)
2632 if( camera == NULL){
2633 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2634 return CAMERA_ERROR_INVALID_PARAMETER;
2636 int ret = CAMERA_ERROR_NONE;
2638 camera_cli_s *pc = (camera_cli_s *)camera;
2639 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
2641 if (pc->cb_info == NULL) {
2642 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2643 return CAMERA_ERROR_INVALID_PARAMETER;
2645 sock_fd = pc->cb_info->fd;
2647 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2648 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, value);
2649 LOGD("ret : 0x%x", ret);
2654 int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
2656 if( camera == NULL){
2657 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2658 return CAMERA_ERROR_INVALID_PARAMETER;
2660 int ret = CAMERA_ERROR_NONE;
2662 camera_cli_s *pc = (camera_cli_s *)camera;
2663 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
2665 if (pc->cb_info == NULL) {
2666 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2667 return CAMERA_ERROR_INVALID_PARAMETER;
2669 sock_fd = pc->cb_info->fd;
2670 int set_iso = (int)iso;
2671 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2672 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_iso);
2673 LOGD("ret : 0x%x", ret);
2678 int camera_attr_set_brightness(camera_h camera, int level)
2680 if( camera == NULL){
2681 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2682 return CAMERA_ERROR_INVALID_PARAMETER;
2684 int ret = CAMERA_ERROR_NONE;
2686 camera_cli_s *pc = (camera_cli_s *)camera;
2687 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
2689 if (pc->cb_info == NULL) {
2690 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2691 return CAMERA_ERROR_INVALID_PARAMETER;
2693 sock_fd = pc->cb_info->fd;
2695 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2696 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2697 LOGD("ret : 0x%x", ret);
2702 int camera_attr_set_contrast(camera_h camera, int level)
2704 if( camera == NULL){
2705 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2706 return CAMERA_ERROR_INVALID_PARAMETER;
2708 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_CONTRAST;
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;
2719 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2720 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2721 LOGD("ret : 0x%x", ret);
2726 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
2728 if (camera == NULL) {
2729 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2730 return CAMERA_ERROR_INVALID_PARAMETER;
2733 if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
2734 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_NOT_SUPPORTED);
2735 return CAMERA_ERROR_NOT_SUPPORTED;
2738 int ret = CAMERA_ERROR_NONE;
2740 camera_cli_s *pc = (camera_cli_s *)camera;
2741 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
2743 if (pc->cb_info == NULL) {
2744 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2745 return CAMERA_ERROR_INVALID_PARAMETER;
2747 sock_fd = pc->cb_info->fd;
2748 int set_whitebalance = (int)wb;
2749 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2750 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_whitebalance);
2751 LOGD("ret : 0x%x", ret);
2756 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
2758 if( camera == NULL){
2759 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2760 return CAMERA_ERROR_INVALID_PARAMETER;
2762 int ret = CAMERA_ERROR_NONE;
2764 camera_cli_s *pc = (camera_cli_s *)camera;
2765 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
2767 if (pc->cb_info == NULL) {
2768 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2769 return CAMERA_ERROR_INVALID_PARAMETER;
2771 sock_fd = pc->cb_info->fd;
2772 int set_effect = (int)effect;
2773 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2774 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_effect);
2775 LOGD("ret : 0x%x", ret);
2780 int camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
2782 if( camera == NULL){
2783 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2784 return CAMERA_ERROR_INVALID_PARAMETER;
2786 int ret = CAMERA_ERROR_NONE;
2788 camera_cli_s *pc = (camera_cli_s *)camera;
2789 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
2791 if (pc->cb_info == NULL) {
2792 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2793 return CAMERA_ERROR_INVALID_PARAMETER;
2795 sock_fd = pc->cb_info->fd;
2796 int set_mode = (int)mode;
2797 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2798 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2799 LOGD("ret : 0x%x", ret);
2804 int camera_attr_enable_tag(camera_h camera, bool enable)
2806 if( camera == NULL){
2807 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2808 return CAMERA_ERROR_INVALID_PARAMETER;
2810 int ret = CAMERA_ERROR_NONE;
2811 camera_cli_s *pc = (camera_cli_s *)camera;
2812 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
2814 if (pc->cb_info == NULL) {
2815 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2816 return CAMERA_ERROR_INVALID_PARAMETER;
2818 sock_fd = pc->cb_info->fd;
2819 int set_enable = (int)enable;
2821 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2822 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
2823 LOGD("ret : 0x%x", ret);
2828 int camera_attr_set_tag_image_description(camera_h camera, const char *description)
2830 if( camera == NULL){
2831 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2832 return CAMERA_ERROR_INVALID_PARAMETER;
2834 if( description == NULL){
2835 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2836 return CAMERA_ERROR_INVALID_PARAMETER;
2838 int ret = CAMERA_ERROR_NONE;
2839 camera_cli_s *pc = (camera_cli_s *)camera;
2840 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
2842 if (pc->cb_info == NULL) {
2843 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2844 return CAMERA_ERROR_INVALID_PARAMETER;
2846 sock_fd = pc->cb_info->fd;
2847 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2848 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, description);
2849 LOGD("ret : 0x%x", ret);
2854 int camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation)
2856 if( camera == NULL){
2857 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2858 return CAMERA_ERROR_INVALID_PARAMETER;
2860 int ret = CAMERA_ERROR_NONE;
2861 camera_cli_s *pc = (camera_cli_s *)camera;
2862 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
2864 if (pc->cb_info == NULL) {
2865 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2866 return CAMERA_ERROR_INVALID_PARAMETER;
2868 sock_fd = pc->cb_info->fd;
2869 int set_orientation = (int)orientation;
2871 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2872 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_orientation);
2873 LOGD("ret : 0x%x", ret);
2878 int camera_attr_set_tag_software(camera_h camera, const char *software)
2880 if( camera == NULL){
2881 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2882 return CAMERA_ERROR_INVALID_PARAMETER;
2884 if( software == NULL){
2885 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2886 return CAMERA_ERROR_INVALID_PARAMETER;
2888 int ret = CAMERA_ERROR_NONE;
2889 camera_cli_s *pc = (camera_cli_s *)camera;
2890 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
2892 if (pc->cb_info == NULL) {
2893 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2894 return CAMERA_ERROR_INVALID_PARAMETER;
2896 sock_fd = pc->cb_info->fd;
2897 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2898 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, software);
2899 LOGD("ret : 0x%x", ret);
2904 int camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
2906 if( camera == NULL){
2907 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2908 return CAMERA_ERROR_INVALID_PARAMETER;
2910 int ret = CAMERA_ERROR_NONE;
2911 camera_cli_s *pc = (camera_cli_s *)camera;
2912 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
2914 if (pc->cb_info == NULL) {
2915 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2916 return CAMERA_ERROR_INVALID_PARAMETER;
2918 sock_fd = pc->cb_info->fd;
2919 double set_geotag[3] = { latitude, longitude, altitude };
2921 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2922 muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
2923 set_geotag, sizeof(set_geotag), sizeof(double));
2924 LOGD("ret : 0x%x", ret);
2929 int camera_attr_remove_geotag(camera_h camera)
2931 if( camera == NULL){
2932 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2933 return CAMERA_ERROR_INVALID_PARAMETER;
2935 int ret = CAMERA_ERROR_NONE;
2936 camera_cli_s *pc = (camera_cli_s *)camera;
2937 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
2939 if (pc->cb_info == NULL) {
2940 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2941 return CAMERA_ERROR_INVALID_PARAMETER;
2943 sock_fd = pc->cb_info->fd;
2944 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2945 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2946 LOGD("ret : 0x%x", ret);
2951 int camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
2953 if( camera == NULL){
2954 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2955 return CAMERA_ERROR_INVALID_PARAMETER;
2957 int ret = CAMERA_ERROR_NONE;
2958 camera_cli_s *pc = (camera_cli_s *)camera;
2959 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
2961 if (pc->cb_info == NULL) {
2962 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2963 return CAMERA_ERROR_INVALID_PARAMETER;
2965 sock_fd = pc->cb_info->fd;
2966 int set_mode = (int)mode;
2968 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2969 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2970 LOGD("ret : 0x%x", ret);
2975 int camera_attr_get_zoom(camera_h camera, int *zoom)
2977 if( camera == NULL || zoom == NULL){
2978 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2979 return CAMERA_ERROR_INVALID_PARAMETER;
2981 int ret = CAMERA_ERROR_NONE;
2983 camera_cli_s *pc = (camera_cli_s *)camera;
2984 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
2987 if (pc->cb_info == NULL) {
2988 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2989 return CAMERA_ERROR_INVALID_PARAMETER;
2991 sock_fd = pc->cb_info->fd;
2993 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2994 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2996 if (ret == CAMERA_ERROR_NONE) {
2997 muse_camera_msg_get(get_zoom, pc->cb_info->recvMsg);
3000 LOGD("ret : 0x%x", ret);
3005 int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
3007 if( camera == NULL || min == NULL || max == NULL ){
3008 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3009 return CAMERA_ERROR_INVALID_PARAMETER;
3011 int ret = CAMERA_ERROR_NONE;
3012 camera_cli_s *pc = (camera_cli_s *)camera;
3014 if (pc->cb_info == NULL) {
3015 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3016 return CAMERA_ERROR_INVALID_PARAMETER;
3018 sock_fd = pc->cb_info->fd;
3019 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
3023 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3024 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3026 if (ret == CAMERA_ERROR_NONE) {
3027 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3028 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3032 LOGD("ret : 0x%x", ret);
3037 int camera_attr_get_af_mode( camera_h camera, camera_attr_af_mode_e *mode)
3039 if( camera == NULL || mode == NULL){
3040 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3041 return CAMERA_ERROR_INVALID_PARAMETER;
3043 int ret = CAMERA_ERROR_NONE;
3044 camera_cli_s *pc = (camera_cli_s *)camera;
3046 if (pc->cb_info == NULL) {
3047 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3048 return CAMERA_ERROR_INVALID_PARAMETER;
3050 sock_fd = pc->cb_info->fd;
3051 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
3054 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3055 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3057 if (ret == CAMERA_ERROR_NONE) {
3058 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3059 *mode = (camera_attr_af_mode_e)get_mode;
3061 LOGD("ret : 0x%x", ret);
3066 int camera_attr_get_exposure_mode( camera_h camera, camera_attr_exposure_mode_e *mode)
3068 if( camera == NULL|| mode == NULL){
3069 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3070 return CAMERA_ERROR_INVALID_PARAMETER;
3072 int ret = CAMERA_ERROR_NONE;
3073 camera_cli_s *pc = (camera_cli_s *)camera;
3075 if (pc->cb_info == NULL) {
3076 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3077 return CAMERA_ERROR_INVALID_PARAMETER;
3079 sock_fd = pc->cb_info->fd;
3080 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
3083 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3084 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3086 if (ret == CAMERA_ERROR_NONE) {
3087 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3088 *mode = (camera_attr_exposure_mode_e)get_mode;
3090 LOGD("ret : 0x%x", ret);
3094 int camera_attr_get_exposure(camera_h camera, int *value)
3096 if( camera == NULL || value == NULL){
3097 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3098 return CAMERA_ERROR_INVALID_PARAMETER;
3100 int ret = CAMERA_ERROR_NONE;
3101 camera_cli_s *pc = (camera_cli_s *)camera;
3103 if (pc->cb_info == NULL) {
3104 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3105 return CAMERA_ERROR_INVALID_PARAMETER;
3107 sock_fd = pc->cb_info->fd;
3108 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
3111 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3112 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3114 if (ret == CAMERA_ERROR_NONE) {
3115 muse_camera_msg_get(get_value, pc->cb_info->recvMsg);
3118 LOGD("ret : 0x%x", ret);
3123 int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
3125 if( camera == NULL || min == NULL || max == NULL ){
3126 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3127 return CAMERA_ERROR_INVALID_PARAMETER;
3129 int ret = CAMERA_ERROR_NONE;
3130 camera_cli_s *pc = (camera_cli_s *)camera;
3132 if (pc->cb_info == NULL) {
3133 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3134 return CAMERA_ERROR_INVALID_PARAMETER;
3136 sock_fd = pc->cb_info->fd;
3137 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
3141 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3142 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3144 if (ret == CAMERA_ERROR_NONE) {
3145 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3146 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3150 LOGD("ret : 0x%x", ret);
3155 int camera_attr_get_iso( camera_h camera, camera_attr_iso_e *iso)
3157 if( camera == NULL || iso == NULL){
3158 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3159 return CAMERA_ERROR_INVALID_PARAMETER;
3161 int ret = CAMERA_ERROR_NONE;
3162 camera_cli_s *pc = (camera_cli_s *)camera;
3164 if (pc->cb_info == NULL) {
3165 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3166 return CAMERA_ERROR_INVALID_PARAMETER;
3168 sock_fd = pc->cb_info->fd;
3169 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
3172 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3173 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3175 if (ret == CAMERA_ERROR_NONE) {
3176 muse_camera_msg_get(get_iso, pc->cb_info->recvMsg);
3177 *iso = (camera_attr_iso_e)get_iso;
3179 LOGD("ret : 0x%x", ret);
3184 int camera_attr_get_brightness(camera_h camera, int *level)
3186 if( camera == NULL || level == NULL){
3187 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3188 return CAMERA_ERROR_INVALID_PARAMETER;
3190 int ret = CAMERA_ERROR_NONE;
3191 camera_cli_s *pc = (camera_cli_s *)camera;
3193 if (pc->cb_info == NULL) {
3194 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3195 return CAMERA_ERROR_INVALID_PARAMETER;
3197 sock_fd = pc->cb_info->fd;
3198 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
3201 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3202 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3204 if (ret == CAMERA_ERROR_NONE) {
3205 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3208 LOGD("ret : 0x%x", ret);
3213 int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
3215 if( camera == NULL || min == NULL || max == NULL ){
3216 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3217 return CAMERA_ERROR_INVALID_PARAMETER;
3219 int ret = CAMERA_ERROR_NONE;
3220 camera_cli_s *pc = (camera_cli_s *)camera;
3222 if (pc->cb_info == NULL) {
3223 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3224 return CAMERA_ERROR_INVALID_PARAMETER;
3226 sock_fd = pc->cb_info->fd;
3227 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
3231 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3232 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3234 if (ret == CAMERA_ERROR_NONE) {
3235 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3236 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3240 LOGD("ret : 0x%x", ret);
3245 int camera_attr_get_contrast(camera_h camera, int *level)
3247 if( camera == NULL || level == NULL){
3248 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3249 return CAMERA_ERROR_INVALID_PARAMETER;
3251 int ret = CAMERA_ERROR_NONE;
3252 camera_cli_s *pc = (camera_cli_s *)camera;
3253 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
3255 if (pc->cb_info == NULL) {
3256 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3257 return CAMERA_ERROR_INVALID_PARAMETER;
3259 sock_fd = pc->cb_info->fd;
3262 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3263 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3265 if (ret == CAMERA_ERROR_NONE) {
3266 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3269 LOGD("ret : 0x%x", ret);
3274 int camera_attr_get_contrast_range(camera_h camera, int *min , int *max)
3276 if( camera == NULL || min == NULL || max == NULL ){
3277 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3278 return CAMERA_ERROR_INVALID_PARAMETER;
3280 int ret = CAMERA_ERROR_NONE;
3281 camera_cli_s *pc = (camera_cli_s *)camera;
3282 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
3284 if (pc->cb_info == NULL) {
3285 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3286 return CAMERA_ERROR_INVALID_PARAMETER;
3288 sock_fd = pc->cb_info->fd;
3292 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3293 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3295 if (ret == CAMERA_ERROR_NONE) {
3296 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3297 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3301 LOGD("ret : 0x%x", ret);
3306 int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
3308 if( camera == NULL || wb == NULL){
3309 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3310 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_WHITEBALANCE;
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_wb, pc->cb_info->recvMsg);
3328 *wb = (camera_attr_whitebalance_e)get_wb;
3330 LOGD("ret : 0x%x", ret);
3335 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
3337 if( camera == NULL || effect == NULL ){
3338 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3339 return CAMERA_ERROR_INVALID_PARAMETER;
3342 int ret = CAMERA_ERROR_NONE;
3343 camera_cli_s *pc = (camera_cli_s *)camera;
3344 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
3346 if (pc->cb_info == NULL) {
3347 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3348 return CAMERA_ERROR_INVALID_PARAMETER;
3350 sock_fd = pc->cb_info->fd;
3353 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3354 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3356 if (ret == CAMERA_ERROR_NONE) {
3357 muse_camera_msg_get(get_effect, pc->cb_info->recvMsg);
3358 *effect = (camera_attr_effect_mode_e)get_effect;
3360 LOGD("ret : 0x%x", ret);
3365 int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
3367 if( camera == NULL || mode == NULL){
3368 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3369 return CAMERA_ERROR_INVALID_PARAMETER;
3372 int ret = CAMERA_ERROR_NONE;
3373 camera_cli_s *pc = (camera_cli_s *)camera;
3374 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
3376 if (pc->cb_info == NULL) {
3377 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3378 return CAMERA_ERROR_INVALID_PARAMETER;
3380 sock_fd = pc->cb_info->fd;
3383 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3384 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3386 if (ret == CAMERA_ERROR_NONE) {
3387 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3388 *mode = (camera_attr_scene_mode_e)get_mode;
3390 LOGD("ret : 0x%x", ret);
3395 int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
3397 if( camera == NULL || enable == NULL){
3398 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3399 return CAMERA_ERROR_INVALID_PARAMETER;
3402 int ret = CAMERA_ERROR_NONE;
3403 camera_cli_s *pc = (camera_cli_s *)camera;
3404 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
3406 if (pc->cb_info == NULL) {
3407 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3408 return CAMERA_ERROR_INVALID_PARAMETER;
3410 sock_fd = pc->cb_info->fd;
3413 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3414 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3416 if (ret == CAMERA_ERROR_NONE) {
3417 muse_camera_msg_get(get_enable, pc->cb_info->recvMsg);
3418 *enable = (bool)get_enable;
3420 LOGD("ret : 0x%x", ret);
3425 int camera_attr_get_tag_image_description(camera_h camera, char **description)
3427 if( camera == NULL || description == NULL){
3428 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3429 return CAMERA_ERROR_INVALID_PARAMETER;
3432 int ret = CAMERA_ERROR_NONE;
3433 camera_cli_s *pc = (camera_cli_s *)camera;
3434 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
3436 if (pc->cb_info == NULL) {
3437 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3438 return CAMERA_ERROR_INVALID_PARAMETER;
3440 sock_fd = pc->cb_info->fd;
3441 char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3443 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3444 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3446 if (ret == CAMERA_ERROR_NONE) {
3447 muse_camera_msg_get_string(get_description, pc->cb_info->recvMsg);
3448 *description = strdup(get_description);
3450 LOGD("ret : 0x%x", ret);
3455 int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
3457 if( camera == NULL || orientation == NULL){
3458 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3459 return CAMERA_ERROR_INVALID_PARAMETER;
3462 int ret = CAMERA_ERROR_NONE;
3463 camera_cli_s *pc = (camera_cli_s *)camera;
3464 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
3466 if (pc->cb_info == NULL) {
3467 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3468 return CAMERA_ERROR_INVALID_PARAMETER;
3470 sock_fd = pc->cb_info->fd;
3471 int get_orientation;
3473 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3474 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3476 if (ret == CAMERA_ERROR_NONE) {
3477 muse_camera_msg_get(get_orientation, pc->cb_info->recvMsg);
3478 *orientation = (camera_attr_tag_orientation_e)get_orientation;
3479 LOGD("success, orientation : %d", *orientation);
3481 LOGD("ret : 0x%x", ret);
3486 int camera_attr_get_tag_software(camera_h camera, char **software)
3488 if( camera == NULL || software == NULL ){
3489 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3490 return CAMERA_ERROR_INVALID_PARAMETER;
3493 int ret = CAMERA_ERROR_NONE;
3494 camera_cli_s *pc = (camera_cli_s *)camera;
3495 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
3497 if (pc->cb_info == NULL) {
3498 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3499 return CAMERA_ERROR_INVALID_PARAMETER;
3501 sock_fd = pc->cb_info->fd;
3502 char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3504 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3505 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3507 if (ret == CAMERA_ERROR_NONE) {
3508 muse_camera_msg_get_string(get_software, pc->cb_info->recvMsg);
3509 *software = strdup(get_software);
3511 LOGD("ret : 0x%x", ret);
3516 int camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
3518 if( camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL){
3519 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3520 return CAMERA_ERROR_INVALID_PARAMETER;
3523 int ret = CAMERA_ERROR_NONE;
3524 camera_cli_s *pc = (camera_cli_s *)camera;
3525 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
3526 double get_geotag[3] = {0,};
3528 if (pc->cb_info == NULL) {
3529 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3530 return CAMERA_ERROR_INVALID_PARAMETER;
3532 sock_fd = pc->cb_info->fd;
3534 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3535 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3537 if (ret == CAMERA_ERROR_NONE) {
3538 muse_camera_msg_get_array(get_geotag, pc->cb_info->recvMsg);
3539 *latitude = get_geotag[0];
3540 *longitude = get_geotag[1];
3541 *altitude = get_geotag[2];
3543 LOGE("Returned value is not valid : 0x%x", valid);
3548 LOGD("ret : 0x%x", ret);
3553 int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
3555 if( camera == NULL || mode == NULL){
3556 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3557 return CAMERA_ERROR_INVALID_PARAMETER;
3560 int ret = CAMERA_ERROR_NONE;
3561 camera_cli_s *pc = (camera_cli_s *)camera;
3562 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
3564 if (pc->cb_info == NULL) {
3565 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3566 return CAMERA_ERROR_INVALID_PARAMETER;
3568 sock_fd = pc->cb_info->fd;
3571 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3572 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3574 if (ret == CAMERA_ERROR_NONE) {
3575 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3576 *mode = (camera_attr_flash_mode_e)get_mode;
3578 LOGD("ret : 0x%x", ret);
3583 int camera_attr_foreach_supported_af_mode( camera_h camera, camera_attr_supported_af_mode_cb foreach_cb , void *user_data)
3585 if( camera == NULL || foreach_cb == NULL){
3586 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3587 return CAMERA_ERROR_INVALID_PARAMETER;
3589 int ret = CAMERA_ERROR_NONE;
3591 camera_cli_s *pc = (camera_cli_s *)camera;
3592 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
3594 LOGD("Enter, handle :%x", pc->remote_handle);
3597 if (pc->cb_info == NULL) {
3598 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3599 return CAMERA_ERROR_INVALID_PARAMETER;
3601 sock_fd = pc->cb_info->fd;
3602 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
3603 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
3605 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3606 LOGD("ret : 0x%x", ret);
3611 int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb , void *user_data)
3613 if( camera == NULL || foreach_cb == NULL){
3614 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3615 return CAMERA_ERROR_INVALID_PARAMETER;
3617 int ret = CAMERA_ERROR_NONE;
3619 camera_cli_s *pc = (camera_cli_s *)camera;
3620 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
3622 LOGD("Enter, handle :%x", pc->remote_handle);
3625 if (pc->cb_info == NULL) {
3626 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3627 return CAMERA_ERROR_INVALID_PARAMETER;
3629 sock_fd = pc->cb_info->fd;
3630 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
3631 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
3633 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3634 LOGD("ret : 0x%x", ret);
3639 int camera_attr_foreach_supported_iso( camera_h camera, camera_attr_supported_iso_cb foreach_cb , void *user_data)
3641 if( camera == NULL || foreach_cb == NULL){
3642 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3643 return CAMERA_ERROR_INVALID_PARAMETER;
3645 int ret = CAMERA_ERROR_NONE;
3647 camera_cli_s *pc = (camera_cli_s *)camera;
3648 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
3650 LOGD("Enter, handle :%x", pc->remote_handle);
3653 if (pc->cb_info == NULL) {
3654 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3655 return CAMERA_ERROR_INVALID_PARAMETER;
3657 sock_fd = pc->cb_info->fd;
3658 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
3659 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
3661 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3662 LOGD("ret : 0x%x", ret);
3667 int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb , void *user_data)
3669 if( camera == NULL || foreach_cb == NULL){
3670 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3671 return CAMERA_ERROR_INVALID_PARAMETER;
3673 int ret = CAMERA_ERROR_NONE;
3675 camera_cli_s *pc = (camera_cli_s *)camera;
3676 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
3678 LOGD("Enter, handle :%x", pc->remote_handle);
3681 if (pc->cb_info == NULL) {
3682 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3683 return CAMERA_ERROR_INVALID_PARAMETER;
3685 sock_fd = pc->cb_info->fd;
3686 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
3687 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
3689 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3690 LOGD("ret : 0x%x", ret);
3695 int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb , void *user_data)
3697 if( camera == NULL || foreach_cb == NULL){
3698 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3699 return CAMERA_ERROR_INVALID_PARAMETER;
3701 int ret = CAMERA_ERROR_NONE;
3703 camera_cli_s *pc = (camera_cli_s *)camera;
3704 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
3706 LOGD("Enter, handle :%x", pc->remote_handle);
3709 if (pc->cb_info == NULL) {
3710 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3711 return CAMERA_ERROR_INVALID_PARAMETER;
3713 sock_fd = pc->cb_info->fd;
3714 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
3715 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
3717 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3718 LOGD("ret : 0x%x", ret);
3723 int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb , void *user_data)
3725 if( camera == NULL || foreach_cb == NULL){
3726 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3727 return CAMERA_ERROR_INVALID_PARAMETER;
3729 int ret = CAMERA_ERROR_NONE;
3731 camera_cli_s *pc = (camera_cli_s *)camera;
3732 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
3734 LOGD("Enter, handle :%x", pc->remote_handle);
3737 if (pc->cb_info == NULL) {
3738 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3739 return CAMERA_ERROR_INVALID_PARAMETER;
3741 sock_fd = pc->cb_info->fd;
3742 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
3743 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
3745 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3746 LOGD("ret : 0x%x", ret);
3751 int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb , void *user_data)
3753 if( camera == NULL || foreach_cb == NULL){
3754 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3755 return CAMERA_ERROR_INVALID_PARAMETER;
3757 int ret = CAMERA_ERROR_NONE;
3759 camera_cli_s *pc = (camera_cli_s *)camera;
3760 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
3762 LOGD("Enter, handle :%x", pc->remote_handle);
3765 if (pc->cb_info == NULL) {
3766 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3767 return CAMERA_ERROR_INVALID_PARAMETER;
3769 sock_fd = pc->cb_info->fd;
3770 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
3771 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = user_data;
3773 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3774 LOGD("ret : 0x%x", ret);
3779 int camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb foreach_cb , void *user_data)
3781 if( camera == NULL || foreach_cb == NULL){
3782 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3783 return CAMERA_ERROR_INVALID_PARAMETER;
3785 int ret = CAMERA_ERROR_NONE;
3787 camera_cli_s *pc = (camera_cli_s *)camera;
3788 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS;
3790 if (pc->cb_info == NULL) {
3791 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3792 return CAMERA_ERROR_INVALID_PARAMETER;
3794 sock_fd = pc->cb_info->fd;
3795 LOGD("Enter, handle :%x", pc->remote_handle);
3796 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = foreach_cb;
3797 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
3799 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3800 LOGD("Enter, handle :%x", pc->remote_handle);
3804 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)
3806 if( camera == NULL || foreach_cb == NULL){
3807 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3808 return CAMERA_ERROR_INVALID_PARAMETER;
3810 int ret = CAMERA_ERROR_NONE;
3812 camera_cli_s *pc = (camera_cli_s *)camera;
3813 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
3815 if (pc->cb_info == NULL) {
3816 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3817 return CAMERA_ERROR_INVALID_PARAMETER;
3819 sock_fd = pc->cb_info->fd;
3820 LOGD("Enter, handle :%x", pc->remote_handle);
3821 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = foreach_cb;
3822 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = user_data;
3824 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
3825 LOGD("ret : 0x%x", ret);
3829 int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
3831 if( camera == NULL || foreach_cb == NULL){
3832 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3833 return CAMERA_ERROR_INVALID_PARAMETER;
3835 int ret = CAMERA_ERROR_NONE;
3837 camera_cli_s *pc = (camera_cli_s *)camera;
3838 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
3840 if (pc->cb_info == NULL) {
3841 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3842 return CAMERA_ERROR_INVALID_PARAMETER;
3844 sock_fd = pc->cb_info->fd;
3845 LOGD("Enter, handle :%x", pc->remote_handle);
3846 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
3847 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
3849 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3850 LOGD("ret : 0x%x", ret);
3855 int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
3857 if( camera == NULL || foreach_cb == NULL){
3858 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3859 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_FOREACH_SUPPORTED_STREAM_ROTATION;
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);
3872 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
3873 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
3875 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3876 LOGD("ret : 0x%x", ret);
3881 int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation)
3883 if( camera == NULL){
3884 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3885 return CAMERA_ERROR_INVALID_PARAMETER;
3888 int ret = CAMERA_ERROR_NONE;
3889 camera_cli_s *pc = (camera_cli_s *)camera;
3890 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
3892 if (pc->cb_info == NULL) {
3893 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3894 return CAMERA_ERROR_INVALID_PARAMETER;
3896 sock_fd = pc->cb_info->fd;
3897 int set_rotation = (int)rotation;
3899 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3900 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
3901 LOGD("ret : 0x%x", ret);
3906 int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation)
3908 if( camera == NULL || rotation == NULL ){
3909 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3910 return CAMERA_ERROR_INVALID_PARAMETER;
3913 int ret = CAMERA_ERROR_NONE;
3914 camera_cli_s *pc = (camera_cli_s *)camera;
3915 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
3917 if (pc->cb_info == NULL) {
3918 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3919 return CAMERA_ERROR_INVALID_PARAMETER;
3921 sock_fd = pc->cb_info->fd;
3924 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3925 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3927 if (ret == CAMERA_ERROR_NONE) {
3928 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
3929 *rotation = (camera_rotation_e)get_rotation;
3931 LOGD("ret : 0x%x", ret);
3936 int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip)
3938 if( camera == NULL){
3939 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3940 return CAMERA_ERROR_INVALID_PARAMETER;
3943 int ret = CAMERA_ERROR_NONE;
3944 camera_cli_s *pc = (camera_cli_s *)camera;
3945 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
3947 if (pc->cb_info == NULL) {
3948 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3949 return CAMERA_ERROR_INVALID_PARAMETER;
3951 sock_fd = pc->cb_info->fd;
3952 int set_flip = (int)flip;
3954 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3955 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
3956 LOGD("ret : 0x%x", ret);
3961 int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip)
3963 if( camera == NULL || flip == NULL ){
3964 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3965 return CAMERA_ERROR_INVALID_PARAMETER;
3968 int ret = CAMERA_ERROR_NONE;
3969 camera_cli_s *pc = (camera_cli_s *)camera;
3970 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
3972 if (pc->cb_info == NULL) {
3973 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3974 return CAMERA_ERROR_INVALID_PARAMETER;
3976 sock_fd = pc->cb_info->fd;
3979 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3980 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3982 if (ret == CAMERA_ERROR_NONE) {
3983 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
3984 *flip = (camera_flip_e)get_flip;
3986 LOGD("ret : 0x%x", ret);
3990 int camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
3992 if( camera == NULL){
3993 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3994 return CAMERA_ERROR_INVALID_PARAMETER;
3997 int ret = CAMERA_ERROR_NONE;
3998 camera_cli_s *pc = (camera_cli_s *)camera;
3999 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
4001 if (pc->cb_info == NULL) {
4002 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4003 return CAMERA_ERROR_INVALID_PARAMETER;
4005 sock_fd = pc->cb_info->fd;
4006 int set_mode = (int)mode;
4008 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4009 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
4010 LOGD("ret : 0x%x", ret);
4015 int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
4017 if (camera == NULL) {
4018 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
4019 return CAMERA_ERROR_INVALID_PARAMETER;
4022 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - mode",CAMERA_ERROR_NOT_SUPPORTED);
4023 return CAMERA_ERROR_NOT_SUPPORTED;
4025 int ret = CAMERA_ERROR_NONE;
4026 camera_cli_s *pc = (camera_cli_s *)camera;
4027 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
4029 if (pc->cb_info == NULL) {
4030 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4031 return CAMERA_ERROR_INVALID_PARAMETER;
4033 sock_fd = pc->cb_info->fd;
4036 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4037 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4039 if (ret == CAMERA_ERROR_NONE) {
4040 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
4041 *mode = (camera_attr_hdr_mode_e)get_mode;
4043 LOGD("ret : 0x%x", ret);
4048 bool camera_attr_is_supported_hdr_capture(camera_h camera)
4050 if( camera == NULL){
4051 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4055 int ret = CAMERA_ERROR_NONE;
4056 camera_cli_s *pc = (camera_cli_s *)camera;
4057 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
4059 if (pc->cb_info == NULL) {
4060 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4061 return CAMERA_ERROR_INVALID_PARAMETER;
4063 sock_fd = pc->cb_info->fd;
4064 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4065 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4066 LOGD("ret : 0x%x", ret);
4071 int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data)
4073 if (camera == NULL) {
4074 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4075 return CAMERA_ERROR_INVALID_PARAMETER;
4077 if (callback == NULL) {
4078 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - callback", CAMERA_ERROR_NOT_SUPPORTED);
4079 return CAMERA_ERROR_NOT_SUPPORTED;
4081 int ret = CAMERA_ERROR_NONE;
4083 camera_cli_s *pc = (camera_cli_s *)camera;
4084 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
4086 if (pc->cb_info == NULL) {
4087 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4088 return CAMERA_ERROR_INVALID_PARAMETER;
4090 sock_fd = pc->cb_info->fd;
4091 LOGD("Enter, handle :%x", pc->remote_handle);
4093 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = callback;
4094 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = user_data;
4096 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4097 LOGD("ret : 0x%x", ret);
4102 int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
4104 if( camera == NULL){
4105 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4106 return CAMERA_ERROR_INVALID_PARAMETER;
4109 int ret = CAMERA_ERROR_NONE;
4111 camera_cli_s *pc = (camera_cli_s *)camera;
4112 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
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, handle :%x", pc->remote_handle);
4121 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
4122 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
4124 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4125 LOGD("ret : 0x%x", ret);
4130 int camera_attr_enable_anti_shake(camera_h camera, bool enable)
4132 if (camera == NULL) {
4133 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4134 return CAMERA_ERROR_INVALID_PARAMETER;
4137 int ret = CAMERA_ERROR_NONE;
4138 camera_cli_s *pc = (camera_cli_s *)camera;
4139 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
4141 if (pc->cb_info == NULL) {
4142 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4143 return CAMERA_ERROR_INVALID_PARAMETER;
4145 sock_fd = pc->cb_info->fd;
4146 int set_enable = (int)enable;
4148 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4149 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4150 LOGD("ret : 0x%x", ret);
4155 int camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled)
4157 if (camera == NULL) {
4158 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4159 return CAMERA_ERROR_INVALID_PARAMETER;
4161 if (enabled == NULL) {
4162 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4163 return CAMERA_ERROR_NOT_SUPPORTED;
4165 int ret = CAMERA_ERROR_NONE;
4166 camera_cli_s *pc = (camera_cli_s *)camera;
4167 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
4169 if (pc->cb_info == NULL) {
4170 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4171 return CAMERA_ERROR_INVALID_PARAMETER;
4173 sock_fd = pc->cb_info->fd;
4176 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4177 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4179 if (ret == CAMERA_ERROR_NONE) {
4180 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4181 *enabled = (bool)get_enabled;
4183 LOGD("ret : 0x%x", ret);
4188 bool camera_attr_is_supported_anti_shake(camera_h camera)
4191 if( camera == NULL){
4192 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4196 int ret = CAMERA_ERROR_NONE;
4197 camera_cli_s *pc = (camera_cli_s *)camera;
4198 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
4200 if (pc->cb_info == NULL) {
4201 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4202 return CAMERA_ERROR_INVALID_PARAMETER;
4204 sock_fd = pc->cb_info->fd;
4205 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4206 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4207 LOGD("ret : 0x%x", ret);
4212 int camera_attr_enable_video_stabilization(camera_h camera, bool enable)
4214 if (camera == NULL) {
4215 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4216 return CAMERA_ERROR_INVALID_PARAMETER;
4219 int ret = CAMERA_ERROR_NONE;
4220 camera_cli_s *pc = (camera_cli_s *)camera;
4221 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
4223 if (pc->cb_info == NULL) {
4224 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4225 return CAMERA_ERROR_INVALID_PARAMETER;
4227 sock_fd = pc->cb_info->fd;
4228 int set_enable = (int)enable;
4230 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4231 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4232 LOGD("ret : 0x%x", ret);
4237 int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
4239 if (camera == NULL) {
4240 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
4241 return CAMERA_ERROR_INVALID_PARAMETER;
4243 if (enabled == NULL) {
4244 LOGE("INVALID_PARAMETER(0x%08x) - enabled",CAMERA_ERROR_INVALID_PARAMETER);
4245 return CAMERA_ERROR_NOT_SUPPORTED;
4247 int ret = CAMERA_ERROR_NONE;
4248 camera_cli_s *pc = (camera_cli_s *)camera;
4249 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
4251 if (pc->cb_info == NULL) {
4252 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4253 return CAMERA_ERROR_INVALID_PARAMETER;
4255 sock_fd = pc->cb_info->fd;
4258 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4259 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4261 if (ret == CAMERA_ERROR_NONE) {
4262 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4263 *enabled = (bool)get_enabled;
4265 LOGD("ret : 0x%x", ret);
4270 bool camera_attr_is_supported_video_stabilization(camera_h camera)
4272 if( camera == NULL){
4273 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4277 int ret = CAMERA_ERROR_NONE;
4278 camera_cli_s *pc = (camera_cli_s *)camera;
4279 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
4281 if (pc->cb_info == NULL) {
4282 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4283 return CAMERA_ERROR_INVALID_PARAMETER;
4285 sock_fd = pc->cb_info->fd;
4286 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4287 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4288 LOGD("ret : 0x%x", ret);
4293 int camera_attr_enable_auto_contrast(camera_h camera, bool enable)
4295 if( camera == NULL){
4296 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4297 return CAMERA_ERROR_INVALID_PARAMETER;
4300 int ret = CAMERA_ERROR_NONE;
4301 camera_cli_s *pc = (camera_cli_s *)camera;
4302 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
4304 if (pc->cb_info == NULL) {
4305 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4306 return CAMERA_ERROR_INVALID_PARAMETER;
4308 sock_fd = pc->cb_info->fd;
4309 int set_enable = (int)enable;
4311 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4312 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4313 LOGD("ret : 0x%x", ret);
4318 int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
4320 if (camera == NULL) {
4321 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4322 return CAMERA_ERROR_INVALID_PARAMETER;
4324 if (enabled == NULL) {
4325 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4326 return CAMERA_ERROR_INVALID_PARAMETER;
4328 int ret = CAMERA_ERROR_NONE;
4329 camera_cli_s *pc = (camera_cli_s *)camera;
4330 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
4332 if (pc->cb_info == NULL) {
4333 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4334 return CAMERA_ERROR_INVALID_PARAMETER;
4336 sock_fd = pc->cb_info->fd;
4339 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4340 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4342 if (ret == CAMERA_ERROR_NONE) {
4343 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4344 *enabled = (bool)get_enabled;
4346 LOGD("ret : 0x%x", ret);
4351 bool camera_attr_is_supported_auto_contrast(camera_h camera)
4353 if( camera == NULL){
4354 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4358 int ret = CAMERA_ERROR_NONE;
4359 camera_cli_s *pc = (camera_cli_s *)camera;
4360 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
4362 if (pc->cb_info == NULL) {
4363 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4364 return CAMERA_ERROR_INVALID_PARAMETER;
4366 sock_fd = pc->cb_info->fd;
4367 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4368 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4369 LOGD("ret : 0x%x", ret);
4374 int camera_attr_disable_shutter_sound(camera_h camera, bool disable)
4376 if (camera == NULL) {
4377 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4378 return CAMERA_ERROR_INVALID_PARAMETER;
4381 int ret = CAMERA_ERROR_NONE;
4382 camera_cli_s *pc = (camera_cli_s *)camera;
4383 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
4385 if (pc->cb_info == NULL) {
4386 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4387 return CAMERA_ERROR_INVALID_PARAMETER;
4389 sock_fd = pc->cb_info->fd;
4390 int set_disable = (int)disable;
4392 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4393 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_disable);
4394 LOGD("ret : 0x%x", ret);