capi-media-camera update for daemon
[platform/core/api/camera.git] / src / camera.c
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 #include <mm.h>
22 #include <mm_types.h>
23 #include <camera.h>
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>
29 //#include <glib.h>
30 #include <dlog.h>
31 #include <Elementary.h>
32 #include <mm_camcorder_client.h>
33 #include <Evas.h>
34 #ifdef HAVE_WAYLAND
35 #include <Ecore_Wayland.h>
36 #else
37 #include <Ecore.h>
38 #endif
39
40 #ifdef LOG_TAG
41 #undef LOG_TAG
42 #endif
43 #define LOG_TAG "TIZEN_N_CAMERA_CLIENT"
44
45
46 static void _client_user_callback(callback_cb_info_s * cb_info, muse_camera_event_e event )
47 {
48         char *recvMsg = cb_info->recvMsg;
49         int param, param1, param2;
50         LOGD("get event %d", event);
51
52         switch (event) {
53                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
54                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
55                         muse_camera_msg_get(param1, recvMsg);
56                         muse_camera_msg_get(param2, recvMsg);
57                         break;
58                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
59                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
60                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
61                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
62                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
63                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
64                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
65                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
66                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
67                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
68                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
69                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
70                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
71                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
72                         muse_camera_msg_get(param, recvMsg);
73                         break;
74                 default:
75                         break;
76         }
77
78         switch(event) {
79                 case MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE:
80                 {
81                         int cb_previous, cb_current, cb_by_policy;
82                         muse_camera_msg_get(cb_previous, recvMsg);
83                         muse_camera_msg_get(cb_current, recvMsg);
84                         muse_camera_msg_get(cb_by_policy, recvMsg);
85                         ((camera_state_changed_cb)cb_info->user_cb[event])((camera_state_e)cb_previous,
86                                                                                                         (camera_state_e)cb_current,
87                                                                                                         (bool)cb_by_policy,
88                                                                                                         cb_info->user_data[event]);
89                         break;
90                 }
91                 case MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE:
92                 {
93                         int cb_state;
94                         muse_camera_msg_get(cb_state, recvMsg);
95                         ((camera_focus_changed_cb)cb_info->user_cb[event])((camera_focus_state_e)cb_state,
96                                                                                                         cb_info->user_data[event]);
97                         break;
98                 }
99                 case MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE:
100                         ((camera_capture_completed_cb)cb_info->user_cb[event])(cb_info->user_data[event]);
101                         break;
102                 case MUSE_CAMERA_EVENT_TYPE_PREVIEW:
103                         ((camera_preview_cb)cb_info->user_cb[event])(NULL,
104                                                                                                         cb_info->user_data[event]);
105                         break;
106                 case MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW:
107                         ((camera_media_packet_preview_cb)cb_info->user_cb[event])(NULL,
108                                                                                                                         cb_info->user_data[event]);
109                         break;
110                 case MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS:
111                 {
112                         int progress;
113                         muse_camera_msg_get(progress, recvMsg);
114                         ((camera_attr_hdr_progress_cb)cb_info->user_cb[event])(progress,
115                                                                                                                         cb_info->user_data[event]);
116                         break;
117                 }
118                 case MUSE_CAMERA_EVENT_TYPE_INTERRUPTED:
119                 {
120                         int cb_policy, cb_previous, cb_current;
121                         muse_camera_msg_get(cb_policy, recvMsg);
122                         muse_camera_msg_get(cb_previous, recvMsg);
123                         muse_camera_msg_get(cb_current, recvMsg);
124                         ((camera_interrupted_cb)cb_info->user_cb[event])((camera_policy_e)cb_policy,
125                                                                                                                 (camera_state_e)cb_previous,
126                                                                                                                 (camera_state_e)cb_current,
127                                                                                                                 cb_info->user_data[event]);
128                         break;
129                 }
130                 case MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION:
131                 {
132                         int count;
133                         muse_camera_msg_get(count, recvMsg);
134                         ((camera_face_detected_cb)cb_info->user_cb[event])(NULL,
135                                                                                                         count,
136                                                                                                         cb_info->user_data[event]);
137                         break;
138                 }
139                 case MUSE_CAMERA_EVENT_TYPE_ERROR:
140                 {
141                         int cb_error, cb_current_state;
142                         muse_camera_msg_get(cb_error, recvMsg);
143                         muse_camera_msg_get(cb_current_state, recvMsg);
144                         ((camera_error_cb)cb_info->user_cb[event])((camera_error_e)cb_error,
145                                                                                                         (camera_state_e)cb_current_state,
146                                                                                                         cb_info->user_data[event]);
147                         break;
148                 }
149                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
150                         ((camera_supported_preview_resolution_cb)cb_info->user_cb[event])(param1, param2,
151                                                                                                                                         cb_info->user_data[event]);
152                         break;
153                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
154                         ((camera_supported_capture_resolution_cb)cb_info->user_cb[event])(param1, param2,
155                                                                                                                                         cb_info->user_data[event]);
156                         break;
157                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
158                         ((camera_supported_capture_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
159                                                                                                                                         cb_info->user_data[event]);
160                         break;
161                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
162                         ((camera_supported_preview_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
163                                                                                                                                         cb_info->user_data[event]);
164                         break;
165                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
166                         ((camera_attr_supported_af_mode_cb)cb_info->user_cb[event])((camera_attr_af_mode_e)param,
167                                                                                                                                         cb_info->user_data[event]);
168                         break;
169                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
170                         ((camera_attr_supported_exposure_mode_cb)cb_info->user_cb[event])((camera_attr_exposure_mode_e)param,
171                                                                                                                                         cb_info->user_data[event]);
172                         break;
173                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
174                         ((camera_attr_supported_iso_cb)cb_info->user_cb[event])((camera_attr_iso_e)param,
175                                                                                                                         cb_info->user_data[event]);
176                         break;
177                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
178                         ((camera_attr_supported_whitebalance_cb)cb_info->user_cb[event])((camera_attr_whitebalance_e)param,
179                                                                                                                                                 cb_info->user_data[event]);
180                         break;
181                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
182                         ((camera_attr_supported_effect_cb)cb_info->user_cb[event])((camera_attr_effect_mode_e)param,
183                                                                                                                                 cb_info->user_data[event]);
184                         break;
185                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
186                         ((camera_attr_supported_scene_mode_cb)cb_info->user_cb[event])((camera_attr_scene_mode_e)param,
187                                                                                                                                         cb_info->user_data[event]);
188                         break;
189                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
190                         ((camera_attr_supported_flash_mode_cb)cb_info->user_cb[event])((camera_attr_flash_mode_e)param,
191                                                                                                                                         cb_info->user_data[event]);
192                         break;
193                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
194                         ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
195                                                                                                                         cb_info->user_data[event]);
196                         break;
197                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
198                         ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
199                                                                                                                         cb_info->user_data[event]);
200                         break;
201                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
202                         ((camera_attr_supported_stream_flip_cb)cb_info->user_cb[event])((camera_flip_e)param,
203                                                                                                                                         cb_info->user_data[event]);
204                         break;
205                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
206                         ((camera_attr_supported_stream_rotation_cb)cb_info->user_cb[event])((camera_rotation_e)param,
207                                                                                                                                         cb_info->user_data[event]);
208                         break;
209                 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
210                         ((camera_attr_supported_theater_mode_cb)cb_info->user_cb[event])((camera_attr_theater_mode_e)param,
211                                                                                                                                         cb_info->user_data[event]);
212                         break;
213                 case MUSE_CAMERA_EVENT_TYPE_CAPTURE:
214                 {
215                         camera_image_data_s *rImage = NULL;
216                         camera_image_data_s *rPostview = NULL;
217                         camera_image_data_s *rThumbnail = NULL;
218                         unsigned char *buf_pos = NULL;
219                         muse_camera_transport_info_s transport_info;
220                         int tKey = 0;
221                         int is_postview = 0;
222                         int is_thumbnail = 0;
223
224                         LOGD("camera capture callback came in.");
225                         muse_camera_msg_get(tKey, recvMsg);
226                         muse_camera_msg_get(is_postview, recvMsg);
227                         muse_camera_msg_get(is_thumbnail, recvMsg);
228
229                         if (tKey != 0) {
230                                 transport_info.tbm_key = tKey;
231                                 LOGD("Read key_info INFO : %d", transport_info.tbm_key);
232
233                                 if (muse_camera_ipc_init_tbm(&transport_info) == FALSE) {
234                                         LOGE("camera_init_tbm ERROR!!");
235                                         break;
236                                 }
237
238                                 if(muse_camera_ipc_import_tbm(&transport_info) == FALSE) {
239                                         LOGE("camera_import_tbm ERROR!!");
240                                         muse_camera_unref_tbm(&transport_info);
241                                         break;
242                                 } else {
243                                         if (transport_info.bo_handle.ptr != NULL) {
244
245                                                 buf_pos = (unsigned char *)transport_info.bo_handle.ptr;
246                                                 rImage = (camera_image_data_s *)buf_pos;
247                                                 LOGE(" !! rImage->size : %d", rImage->size);
248                                                 rImage->data = buf_pos + sizeof(camera_image_data_s);
249                                                 buf_pos += sizeof(camera_image_data_s) + rImage->size;
250                                                 if (is_postview) {
251                                                         rPostview = (camera_image_data_s *)buf_pos;
252                                                         LOGE(" !! rPostview->size : %d", rPostview->size);
253                                                         rPostview->data = buf_pos + sizeof(camera_image_data_s);
254                                                         buf_pos += sizeof(camera_image_data_s) + rPostview->size;
255                                                 }
256                                                 if (is_thumbnail) {
257                                                         rThumbnail = (camera_image_data_s *)buf_pos;
258                                                         rThumbnail->data = buf_pos + sizeof(camera_image_data_s);
259                                                         buf_pos += sizeof(camera_image_data_s) + rThumbnail->size;
260                                                 }
261                                         }
262                                 }
263                         } else {
264                                 LOGE("Get KEY INFO sock msg ERROR!!");
265                                 break;
266                         }
267
268                         LOGD("read image info height: %d, width : %d, size : %d", rImage->height, rImage->width, rImage->size);
269                         ((camera_capturing_cb)cb_info->user_cb[event])(rImage, rPostview, rThumbnail, cb_info->user_data[event]);
270                         muse_camera_unref_tbm(&transport_info);
271                         break;
272                 }
273                 case MUSE_CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR:
274                         break;
275
276                 default:
277                         LOGE("Unknonw event");
278                         break;
279         }
280 }
281
282 static void *client_cb_handler(gpointer data)
283 {
284         int ret;
285         int api;
286         int num_token = 0;
287         int i = 0;
288         int str_pos = 0;
289         int prev_pos = 0;
290         callback_cb_info_s *cb_info = data;
291         char *recvMsg = cb_info->recvMsg;
292         char parseStr[CAMERA_PARSE_STRING_SIZE][MUSE_CAMERA_MSG_MAX_LENGTH] = {{0,0},};
293
294         while (g_atomic_int_get(&cb_info->running)) {
295                 ret = muse_core_ipc_recv_msg(cb_info->fd, recvMsg);
296                 if (ret <= 0)
297                         break;
298                 recvMsg[ret] = '\0';
299
300                 str_pos = 0;
301                 prev_pos = 0;
302                 num_token = 0;
303                 memset(parseStr, 0, CAMERA_PARSE_STRING_SIZE * MUSE_CAMERA_MSG_MAX_LENGTH);
304
305                 LOGD("recvMSg : %s, length : %d", recvMsg, ret);
306
307                 /* Need to split the combined entering msgs.
308                     This module supports up to 200 combined msgs. */
309                 for (str_pos = 0; str_pos < ret; str_pos++) {
310                         if(recvMsg[str_pos] == '}') {
311                                 strncpy(&(parseStr[num_token][0]), recvMsg + prev_pos, str_pos - prev_pos + 1);
312                                 LOGD("splitted msg : %s, Index : %d", &(parseStr[num_token][0]), num_token);
313                                 prev_pos = str_pos+1;
314                                 num_token++;
315                         }
316                 }
317                 LOGD("num_token : %d", num_token);
318
319                 /* Re-construct to the useful single msg. */
320                 for (i = 0; i < num_token; i++) {
321
322                         if (i >= CAMERA_PARSE_STRING_SIZE)
323                                 break;
324
325                         if (muse_camera_msg_get(api, &(parseStr[i][0]))) {
326                                 if(api < MUSE_CAMERA_API_MAX){
327                                         LOGD("Set Condition");
328                                         g_mutex_lock(&(cb_info->pMutex[api]));
329                                         /* The api msgs should be distinguished from the event msg. */
330                                         memset(cb_info->recvApiMsg, 0, strlen(cb_info->recvApiMsg));
331                                         strcpy(cb_info->recvApiMsg, &(parseStr[i][0]));
332                                         LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
333                                         cb_info->activating[api] = 1;
334                                         g_cond_signal(&(cb_info->pCond[api]));
335                                         g_mutex_unlock(&(cb_info->pMutex[api]));
336                                         //msleep(100);
337                                         if(api == MUSE_CAMERA_API_DESTROY) {
338                                                 g_atomic_int_set(&cb_info->running, 0);
339                                                 LOGD("close client cb handler");
340                                         }
341
342                                 } else if(api == MUSE_CAMERA_CB_EVENT) {
343                                         int event;
344                                         if (muse_camera_msg_get(event, &(parseStr[i][0]))) {
345                                                 LOGD("go callback : %d", event);
346                                                 _client_user_callback(cb_info, event);
347                                         }
348                                 }
349                         }else{
350                                 LOGE("Get Msg Failed");
351                         }
352                 }
353
354         }
355         LOGD("client cb exit");
356
357         return NULL;
358 }
359
360 static callback_cb_info_s *client_callback_new(gint sockfd)
361 {
362         callback_cb_info_s *cb_info;
363         GCond *camera_cond;
364         GMutex *camera_mutex;
365         gint *camera_activ;
366         g_return_val_if_fail(sockfd > 0, NULL);
367
368         cb_info = g_new0(callback_cb_info_s, 1);
369         camera_cond = g_new0(GCond, MUSE_CAMERA_API_MAX);
370         camera_mutex = g_new0(GMutex, MUSE_CAMERA_API_MAX);
371         camera_activ = g_new0(gint, MUSE_CAMERA_API_MAX);
372
373         g_atomic_int_set(&cb_info->running, 1);
374         cb_info->fd = sockfd;
375         cb_info->pCond = camera_cond;
376         cb_info->pMutex = camera_mutex;
377         cb_info->activating = camera_activ;
378         cb_info->thread =
379                 g_thread_new("callback_thread", client_cb_handler,
380                              (gpointer) cb_info);
381
382         return cb_info;
383 }
384
385 static int client_wait_for_cb_return(muse_camera_api_e api, callback_cb_info_s *cb_info, int time_out)
386 {
387         int ret = CAMERA_ERROR_NONE;
388         gint64 end_time;
389
390         LOGD("Enter api : %d", api);
391         g_mutex_lock(&(cb_info->pMutex[api]));
392
393         if (cb_info->activating[api] == 0) {
394                 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
395                 if (g_cond_wait_until(&(cb_info->pCond[api]), &(cb_info->pMutex[api]), end_time)) {
396                         LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
397                         if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
398                                 LOGE("Get cb msg failed.");
399                                 ret = CAMERA_ERROR_INVALID_OPERATION;
400                         } else {
401                                 LOGD("Wait passed, ret : 0x%x", ret);
402                         }
403                         if (cb_info->activating[api])
404                                 cb_info->activating[api] = 0;
405                 } else {
406                         LOGD("api %d was TIMED OUT!", api);
407                         ret = CAMERA_ERROR_INVALID_OPERATION;
408                 }
409         } else {
410                 LOGE("condition is already checked for the api : %d.", api);
411                 if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
412                         LOGE("Get cb msg failed.");
413                         ret = CAMERA_ERROR_INVALID_OPERATION;
414                 } else {
415                         LOGD("Already checked condition, Wait passed, ret : 0x%x", ret);
416                 }
417         }
418         g_mutex_unlock(&(cb_info->pMutex[api]));
419         LOGD("ret : 0x%x", ret);
420         return ret;
421 }
422
423 static void client_callback_destroy(callback_cb_info_s * cb_info)
424 {
425         g_return_if_fail(cb_info != NULL);
426
427         LOGI("%p Callback destroyed", cb_info->thread);
428
429         g_thread_join(cb_info->thread);
430         g_thread_unref(cb_info->thread);
431
432         if (cb_info->pCond) {
433                 g_free(cb_info->pCond);
434         }
435         if (cb_info->pMutex) {
436                 g_free(cb_info->pMutex);
437         }
438         if (cb_info->activating) {
439                 g_free(cb_info->activating);
440         }
441         g_free(cb_info);
442 }
443
444 int camera_create(camera_device_e device, camera_h* camera)
445 {
446         if (camera == NULL){
447                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
448                 return CAMERA_ERROR_INVALID_PARAMETER;
449         }
450
451         int sock_fd = -1;
452         char *sndMsg;
453         int ret = CAMERA_ERROR_NONE;
454         camera_cli_s *pc = NULL;
455
456         muse_camera_api_e api = MUSE_CAMERA_API_CREATE;
457         muse_core_api_module_e muse_module = MUSE_CAMERA;
458         int device_type = (int)device;
459
460         sock_fd = muse_core_client_new();
461
462         sndMsg = muse_core_msg_json_factory_new(api,
463                                                                         MUSE_TYPE_INT, "module", muse_module,
464                                                                         MUSE_TYPE_INT, PARAM_DEVICE_TYPE, (int)device_type,
465                                                                         0);
466         muse_core_ipc_send_msg(sock_fd, sndMsg);
467         muse_core_msg_json_factory_free(sndMsg);
468
469         pc = g_new0(camera_cli_s, 1);
470         if (pc == NULL) {
471                 return CAMERA_ERROR_OUT_OF_MEMORY;
472         }
473
474         pc->cb_info = client_callback_new(sock_fd);
475         LOGD("cb info : %d", pc->cb_info->fd);
476
477         ret = client_wait_for_cb_return(api, pc->cb_info, CALLBACK_TIME_OUT);
478         LOGD("ret value : 0x%x", ret);
479         if (ret == CAMERA_ERROR_NONE) {
480                 intptr_t handle = 0;
481                 muse_camera_msg_get_pointer(handle, pc->cb_info->recvMsg);
482                 if (handle == 0) {
483                         LOGE("Receiving Handle Failed!!");
484                         ret = CAMERA_ERROR_INVALID_OPERATION;
485                         goto ErrorExit;
486                 } else {
487                         pc->remote_handle = handle;
488                 }
489                 LOGD("camera create 0x%x", pc->remote_handle);
490                 *camera = (camera_h) pc;
491         } else
492                 goto ErrorExit;
493
494         return ret;
495
496 ErrorExit:
497         g_free(pc);
498         LOGD("ret value : 0x%x", ret);
499         return ret;
500 }
501
502  int camera_destroy(camera_h camera)
503 {
504         if (camera == NULL) {
505                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
506                 return CAMERA_ERROR_INVALID_PARAMETER;
507         }
508
509         int ret = CAMERA_ERROR_NONE;
510         muse_camera_api_e api = MUSE_CAMERA_API_DESTROY;
511         camera_cli_s *pc = (camera_cli_s *)camera;
512         int sock_fd = pc->cb_info->fd;
513         LOGD("ENTER");
514
515         if (pc == NULL) {
516                 LOGD("pc is already nul!!");
517                 return CAMERA_ERROR_INVALID_PARAMETER;
518         } else if (pc->cb_info == NULL) {
519                 return CAMERA_ERROR_INVALID_PARAMETER;
520         }
521
522         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
523         if(ret == CAMERA_ERROR_NONE) {
524                 LOGD("destroy client");
525
526         }
527         client_callback_destroy(pc->cb_info);
528
529         g_free(pc);
530         pc = NULL;
531
532         LOGD("ret : 0x%x", ret);
533         return ret;
534 }
535
536 int camera_start_preview(camera_h camera)
537 {
538         LOGD("start");
539         if (camera == NULL) {
540                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
541                 return CAMERA_ERROR_INVALID_PARAMETER;
542         }
543
544         int ret = CAMERA_ERROR_NONE;
545         muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
546         camera_cli_s *pc = (camera_cli_s *)camera;
547         int sock_fd;
548         char caps[MUSE_CAMERA_MSG_MAX_LENGTH] = {0};
549
550         if (pc->cb_info == NULL) {
551                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
552                 return CAMERA_ERROR_INVALID_PARAMETER;
553         }
554
555         sock_fd = pc->cb_info->fd;
556
557         muse_camera_msg_send_longtime(api, sock_fd, pc->cb_info, ret);
558         LOGD("Enter,  ret :0x%x", ret);
559         if(ret == CAMERA_ERROR_NONE) {
560                 muse_camera_msg_get_string(caps, pc->cb_info->recvMsg);
561                 LOGD("caps : %s", caps);
562                 if (pc->cli_display_handle != 0) {
563                         LOGD("client's display handle is : 0x%x", pc->cli_display_handle);
564                         if(strlen(caps) > 0 &&
565                                         mm_camcorder_client_realize(pc->client_handle, caps) != MM_ERROR_NONE)
566                                 ret = CAMERA_ERROR_INVALID_OPERATION;
567                 } else {
568                         LOGD("display handle is NULL");
569                 }
570         }
571         LOGD("ret : 0x%x", ret);
572         return ret;
573 }
574
575 int camera_stop_preview(camera_h camera)
576 {
577         if (camera == NULL) {
578                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
579                 return CAMERA_ERROR_INVALID_PARAMETER;
580         }
581         int ret = CAMERA_ERROR_NONE;
582         camera_cli_s *pc = (camera_cli_s *)camera;
583         int sock_fd;
584         muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
585
586         if (pc->cb_info == NULL) {
587                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
588                 return CAMERA_ERROR_INVALID_PARAMETER;
589         }
590
591         sock_fd = pc->cb_info->fd;
592         LOGD("Enter");
593         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
594
595         if(ret == CAMERA_ERROR_NONE) {
596                 if (pc->cli_display_handle != 0) {
597                         LOGD("Unrealize client");
598                         if (pc->client_handle != NULL) {
599                                 ret = mm_camcorder_client_unrealize(pc->client_handle);
600                                 mm_camcorder_client_destroy(pc->client_handle);
601                         }
602                 } else {
603                         LOGD("Client did not realized : Display handle is NULL");
604                 }
605         }
606         LOGD("ret : 0x%x", ret);
607         return ret;
608 }
609
610 int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data)
611 {
612         if (camera == NULL) {
613                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
614                 return CAMERA_ERROR_INVALID_PARAMETER;
615         }
616         int ret = CAMERA_ERROR_NONE;
617
618         camera_cli_s *pc = (camera_cli_s *)camera;
619         muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
620         int sock_fd;
621         int is_capturing_cb = 0;
622         int is_completed_cb = 0;
623         LOGD("Enter, handle :%x", pc->remote_handle);
624
625         if (pc->cb_info == NULL) {
626                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
627                 return CAMERA_ERROR_INVALID_PARAMETER;
628         }
629
630         sock_fd = pc->cb_info->fd;
631
632         if (capturing_cb != NULL) {
633                 is_capturing_cb = 1;
634                 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
635                 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
636         }
637
638         if(completed_cb != NULL) {
639                 is_completed_cb = 1;
640                 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
641                 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
642         }
643
644         muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, is_capturing_cb, INT, is_completed_cb);
645         LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
646         LOGD("ret : 0x%x", ret);
647         return ret;
648 }
649
650 bool camera_is_supported_continuous_capture(camera_h camera)
651 {
652         if (camera == NULL) {
653                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
654                 return false;
655         }
656
657         int ret = CAMERA_ERROR_NONE;
658         camera_cli_s *pc = (camera_cli_s *)camera;
659         muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
660         int sock_fd;
661
662         if (pc->cb_info == NULL) {
663                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
664                 return CAMERA_ERROR_INVALID_PARAMETER;
665         }
666
667         sock_fd = pc->cb_info->fd;
668
669         LOGD("Enter, remote_handle : %x", pc->remote_handle);
670         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
671         LOGD("ret : 0x%x", ret);
672         return (bool)ret;
673 }
674
675 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)
676 {
677         if (camera == NULL) {
678                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
679                 return CAMERA_ERROR_INVALID_PARAMETER;
680         }
681
682         int ret = CAMERA_ERROR_NONE;
683
684         camera_cli_s *pc = (camera_cli_s *)camera;
685         muse_camera_api_e api = MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE;
686
687         LOGD("Enter, handle :%x", pc->remote_handle);
688
689         int sock_fd;
690         if (pc->cb_info == NULL) {
691                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
692                 return CAMERA_ERROR_INVALID_PARAMETER;
693         }
694         sock_fd = pc->cb_info->fd;
695
696         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
697         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
698         pc->cb_info->user_cb_completed[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = completed_cb;
699
700         muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, count, INT, interval);
701         LOGD("ret : 0x%x", ret);
702         return ret;
703 }
704
705 int camera_stop_continuous_capture(camera_h camera)
706 {
707         if (camera == NULL) {
708                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
709                 return CAMERA_ERROR_INVALID_PARAMETER;
710         }
711
712
713         int ret = CAMERA_ERROR_NONE;
714
715         camera_cli_s *pc = (camera_cli_s *)camera;
716         muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
717         LOGD("Enter,  handle :%x", pc->remote_handle);
718         int sock_fd;
719         if (pc->cb_info == NULL) {
720                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
721                 return CAMERA_ERROR_INVALID_PARAMETER;
722         }
723         sock_fd = pc->cb_info->fd;
724         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
725         LOGD("ret : 0x%x", ret);
726         return ret;
727 }
728
729 bool camera_is_supported_face_detection(camera_h camera)
730 {
731         if (camera == NULL) {
732                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
733                 return false;
734         }
735         int ret = CAMERA_ERROR_NONE;
736
737         camera_cli_s *pc = (camera_cli_s *)camera;
738         muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
739         int sock_fd;
740         if (pc->cb_info == NULL) {
741                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
742                 return CAMERA_ERROR_INVALID_PARAMETER;
743         }
744         sock_fd = pc->cb_info->fd;
745
746         LOGD("Enter, remote_handle : %x", pc->remote_handle);
747         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
748         LOGD("ret : 0x%x", ret);
749         return (bool)ret;
750 }
751
752 bool camera_is_supported_zero_shutter_lag(camera_h camera)
753 {
754         if (camera == NULL) {
755                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
756                 return false;
757         }
758         int ret = CAMERA_ERROR_NONE;
759
760         camera_cli_s *pc = (camera_cli_s *)camera;
761         muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
762         int sock_fd;
763         if (pc->cb_info == NULL) {
764                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
765                 return CAMERA_ERROR_INVALID_PARAMETER;
766         }
767         sock_fd = pc->cb_info->fd;
768
769         LOGD("Enter, remote_handle : %x", pc->remote_handle);
770         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
771         LOGD("ret : 0x%x", ret);
772         return (bool)ret;
773 }
774
775 bool camera_is_supported_media_packet_preview_cb(camera_h camera)
776 {
777         if (camera == NULL) {
778                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
779                 return false;
780         }
781
782         int ret = CAMERA_ERROR_NONE;
783
784         camera_cli_s *pc = (camera_cli_s *)camera;
785         muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
786         int sock_fd;
787         if (pc->cb_info == NULL) {
788                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
789                 return CAMERA_ERROR_INVALID_PARAMETER;
790         }
791         sock_fd = pc->cb_info->fd;
792
793         LOGD("Enter, remote_handle : %x", pc->remote_handle);
794         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
795         LOGD("ret : 0x%x", ret);
796         return (bool)ret;
797 }
798
799 int camera_get_device_count(camera_h camera, int *device_count)
800 {
801         if (camera == NULL || device_count == NULL) {
802                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
803                 return CAMERA_ERROR_INVALID_PARAMETER;
804         }
805         int ret = CAMERA_ERROR_NONE;
806
807         camera_cli_s *pc = (camera_cli_s *)camera;
808         muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
809         int sock_fd;
810         if (pc->cb_info == NULL) {
811                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
812                 return CAMERA_ERROR_INVALID_PARAMETER;
813         }
814         sock_fd = pc->cb_info->fd;
815         int get_device_count;
816
817         LOGD("Enter, remote_handle : %x", pc->remote_handle);
818         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
819
820         if (ret == CAMERA_ERROR_NONE) {
821                 muse_camera_msg_get(get_device_count, pc->cb_info->recvMsg);
822                 *device_count = get_device_count;
823         }
824         LOGD("ret : 0x%x", ret);
825         return ret;
826 }
827
828 int camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data)
829 {
830         if (camera == NULL) {
831                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
832                 return CAMERA_ERROR_INVALID_PARAMETER;
833         }
834
835         int ret = CAMERA_ERROR_NONE;
836
837         camera_cli_s *pc = (camera_cli_s *)camera;
838         muse_camera_api_e api = MUSE_CAMERA_API_START_FACE_DETECTION;
839
840         LOGD("Enter, handle :%x", pc->remote_handle);
841         int sock_fd;
842         if (pc->cb_info == NULL) {
843                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
844                 return CAMERA_ERROR_INVALID_PARAMETER;
845         }
846         sock_fd = pc->cb_info->fd;
847         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = callback;
848         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = user_data;
849
850         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
851         LOGD("ret : 0x%x", ret);
852         return ret;
853 }
854
855 int camera_stop_face_detection(camera_h camera)
856 {
857         if (camera == NULL) {
858                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
859                 return CAMERA_ERROR_INVALID_PARAMETER;
860         }
861
862         int ret = CAMERA_ERROR_NONE;
863
864         camera_cli_s *pc = (camera_cli_s *)camera;
865         muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
866         LOGD("Enter,  handle :%x", pc->remote_handle);
867         int sock_fd;
868         if (pc->cb_info == NULL) {
869                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
870                 return CAMERA_ERROR_INVALID_PARAMETER;
871         }
872         sock_fd = pc->cb_info->fd;
873         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
874         LOGD("ret : 0x%x", ret);
875         return ret;
876 }
877
878 int camera_get_state(camera_h camera, camera_state_e * state)
879 {
880         if (camera == NULL || state == NULL) {
881                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
882                 return CAMERA_ERROR_INVALID_PARAMETER;
883         }
884         int ret = CAMERA_ERROR_NONE;
885
886         camera_cli_s *pc = (camera_cli_s *)camera;
887         muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
888         int sock_fd;
889         if (pc->cb_info == NULL) {
890                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
891                 return CAMERA_ERROR_INVALID_PARAMETER;
892         }
893         sock_fd = pc->cb_info->fd;
894         int get_state;
895
896         LOGD("Enter, remote_handle : %x", pc->remote_handle);
897         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
898
899         if (ret == CAMERA_ERROR_NONE) {
900                 muse_camera_msg_get(get_state, pc->cb_info->recvMsg);
901                 *state = (camera_state_e)get_state;
902         }
903         LOGD("ret : 0x%x", ret);
904         return ret;
905 }
906
907 int camera_start_focusing(camera_h camera, bool continuous)
908 {
909         if( camera == NULL){
910                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
911                 return CAMERA_ERROR_INVALID_PARAMETER;
912         }
913
914         int ret = CAMERA_ERROR_NONE;
915
916         camera_cli_s *pc = (camera_cli_s *)camera;
917         muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
918         int sock_fd;
919         if (pc->cb_info == NULL) {
920                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
921                 return CAMERA_ERROR_INVALID_PARAMETER;
922         }
923         sock_fd = pc->cb_info->fd;
924         int is_continuous = (int)continuous;
925
926         LOGD("Enter, remote_handle : %x", pc->remote_handle);
927         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, is_continuous);
928         LOGD("ret : 0x%x", ret);
929         return ret;
930 }
931
932 int camera_cancel_focusing(camera_h camera)
933 {
934         if (camera == NULL) {
935                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
936                 return CAMERA_ERROR_INVALID_PARAMETER;
937         }
938
939         int ret = CAMERA_ERROR_NONE;
940
941         camera_cli_s *pc = (camera_cli_s *)camera;
942         muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
943         int sock_fd;
944         if (pc->cb_info == NULL) {
945                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
946                 return CAMERA_ERROR_INVALID_PARAMETER;
947         }
948         sock_fd = pc->cb_info->fd;
949
950         LOGD("Enter, remote_handle : %x", pc->remote_handle);
951         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
952         LOGD("ret : 0x%x", ret);
953         return ret;
954 }
955
956 int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
957 {
958         int ret = CAMERA_ERROR_NONE;
959         int display_surface;
960         void *set_display_handle = NULL;
961         int set_surface = MM_DISPLAY_SURFACE_X;
962         camera_s *handle = NULL;
963         Evas_Object *obj = NULL;
964         const char *object_type = NULL;
965         char socket_path[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
966
967         if (camera == NULL) {
968                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
969                 return CAMERA_ERROR_INVALID_PARAMETER;
970         }
971
972         if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
973                 LOGE("display type[%d] is not NONE, but display handle is NULL", type);
974                 return CAMERA_ERROR_INVALID_PARAMETER;
975         }
976
977         int display_type = (int)type;
978         camera_cli_s *pc = (camera_cli_s *)camera;
979         muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
980         int sock_fd;
981         if (pc->cb_info == NULL) {
982                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
983                 return CAMERA_ERROR_INVALID_PARAMETER;
984         }
985         sock_fd = pc->cb_info->fd;
986
987         LOGD("Enter, remote_handle : %x display : 0x%x", pc->remote_handle, display);
988
989         handle = (camera_s *)camera;
990         handle->display_type = type;
991
992         if (type == CAMERA_DISPLAY_TYPE_NONE) {
993                 set_display_handle = 0;
994                 set_surface = MM_DISPLAY_SURFACE_NULL;
995                 LOGD("display type NONE");
996         } else {
997                 obj = (Evas_Object *)display;
998                 object_type = evas_object_type_get(obj);
999                 if (object_type) {
1000                         if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1001 #ifdef HAVE_WAYLAND
1002                                 MMCamWaylandInfo *wl_info = g_new0(MMCamWaylandInfo, 1);
1003
1004                                 if (wl_info == NULL) {
1005                                         LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
1006                                         return CAMERA_ERROR_OUT_OF_MEMORY;
1007                                 }
1008
1009                                 wl_info->evas_obj = (void *)obj;
1010                                 wl_info->window = (void *)elm_win_wl_window_get(obj);
1011                                 wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
1012                                 wl_info->display = (void *)ecore_wl_display_get();
1013
1014                                 if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
1015                                         LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
1016                                         return CAMERA_ERROR_INVALID_OPERATION;
1017                                 }
1018
1019                                 evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
1020                                                               &wl_info->window_width, &wl_info->window_height);
1021
1022                                 /* set wayland info */
1023                                 handle->wl_info = (void *)wl_info;
1024                                 pc->wl_info = wl_info;
1025                                 set_surface = MM_DISPLAY_SURFACE_X;
1026                                 set_display_handle = (void *)wl_info;
1027
1028                                 LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
1029                                      wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
1030                                      wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
1031 #else /* HAVE_WAYLAND */
1032                                 /* x window overlay surface */
1033                                 set_display_handle = (void *)elm_win_xwindow_get(obj);
1034                                 set_surface = MM_DISPLAY_SURFACE_X;
1035                                 LOGD("display type OVERLAY : handle %p", set_display_handle);
1036 #endif
1037                         } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
1038                                 /* evas object surface */
1039                                 set_display_handle = (void *)display;
1040                                 set_surface = MM_DISPLAY_SURFACE_EVAS;
1041                                 LOGD("display type EVAS : handle %p", set_display_handle);
1042                         } else {
1043                                 LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
1044                                 return CAMERA_ERROR_INVALID_PARAMETER;
1045                         }
1046                 } else {
1047                         LOGE("failed to get evas object type from %p", obj);
1048                         return CAMERA_ERROR_INVALID_PARAMETER;
1049                 }
1050         }
1051
1052         pc->cli_display_handle = (intptr_t)set_display_handle;
1053         display_surface = (int)set_surface;
1054         muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret,
1055                                                             INT, display_type,
1056                                                             INT, display_surface);
1057
1058         if (ret == CAMERA_ERROR_NONE && type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1059                 if (mm_camcorder_client_create(&(pc->client_handle))) {
1060                         LOGE("camera client create Failed");
1061                         return CAMERA_ERROR_INVALID_OPERATION;
1062                 }
1063                 muse_camera_msg_get_string(socket_path, pc->cb_info->recvMsg);
1064                 LOGD("shmsrc stream path : %s", socket_path);
1065                 if(mm_camcorder_client_set_shm_socket_path(pc->client_handle, socket_path)
1066                                 != MM_ERROR_NONE)
1067                         return CAMERA_ERROR_INVALID_OPERATION;
1068                 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1069                                                   MMCAM_DISPLAY_SURFACE, set_surface,
1070                                                   NULL);
1071                 if (ret == MM_ERROR_NONE && type != CAMERA_DISPLAY_TYPE_NONE) {
1072                         ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1073                                                           MMCAM_DISPLAY_HANDLE, pc->cli_display_handle, sizeof(void *),
1074                                                           NULL);
1075                         LOGD("ret : 0x%x", ret);
1076                 }
1077         }
1078         LOGD("ret : 0x%x", ret);
1079         return ret;
1080 }
1081
1082 int camera_set_preview_resolution(camera_h camera,  int width, int height)
1083 {
1084         if( camera == NULL){
1085                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1086                 return CAMERA_ERROR_INVALID_PARAMETER;
1087         }
1088         int ret = CAMERA_ERROR_NONE;
1089
1090         camera_cli_s *pc = (camera_cli_s *)camera;
1091         muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
1092         int sock_fd;
1093         if (pc->cb_info == NULL) {
1094                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1095                 return CAMERA_ERROR_INVALID_PARAMETER;
1096         }
1097         sock_fd = pc->cb_info->fd;
1098
1099         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1100         muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1101         LOGD("ret : 0x%x", ret);
1102         return ret;
1103 }
1104
1105
1106 int camera_set_capture_resolution(camera_h camera,  int width, int height)
1107 {
1108         if (camera == NULL) {
1109                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1110                 return CAMERA_ERROR_INVALID_PARAMETER;
1111         }
1112
1113         int ret = CAMERA_ERROR_NONE;
1114
1115         camera_cli_s *pc = (camera_cli_s *)camera;
1116         muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
1117         int sock_fd;
1118         if (pc->cb_info == NULL) {
1119                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1120                 return CAMERA_ERROR_INVALID_PARAMETER;
1121         }
1122         sock_fd = pc->cb_info->fd;
1123
1124         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1125         muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1126         LOGD("ret : 0x%x", ret);
1127         return ret;
1128 }
1129
1130 int camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
1131 {
1132         if (camera == NULL) {
1133                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1134                 return CAMERA_ERROR_INVALID_PARAMETER;
1135         }
1136
1137         int ret = CAMERA_ERROR_NONE;
1138         int set_format = (int)format;
1139
1140         camera_cli_s *pc = (camera_cli_s *)camera;
1141         muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
1142         int sock_fd;
1143         if (pc->cb_info == NULL) {
1144                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1145                 return CAMERA_ERROR_INVALID_PARAMETER;
1146         }
1147         sock_fd = pc->cb_info->fd;
1148
1149         LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1150         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1151         LOGD("ret : 0x%x", ret);
1152         return ret;
1153 }
1154
1155 int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
1156 {
1157         if (camera == NULL) {
1158                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1159                 return CAMERA_ERROR_INVALID_PARAMETER;
1160         }
1161
1162         int ret = CAMERA_ERROR_NONE;
1163         int set_format = (int)format;
1164
1165         camera_cli_s *pc = (camera_cli_s *)camera;
1166         muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
1167         int sock_fd;
1168         if (pc->cb_info == NULL) {
1169                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1170                 return CAMERA_ERROR_INVALID_PARAMETER;
1171         }
1172         sock_fd = pc->cb_info->fd;
1173
1174         LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1175         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1176         LOGD("ret : 0x%x", ret);
1177         return ret;
1178 }
1179
1180 int camera_get_preview_resolution(camera_h camera,  int *width, int *height)
1181 {
1182         if (camera == NULL || width == NULL || height == NULL) {
1183                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1184                 return CAMERA_ERROR_INVALID_PARAMETER;
1185         }
1186
1187
1188         int ret = CAMERA_ERROR_NONE;
1189
1190         camera_cli_s *pc = (camera_cli_s *)camera;
1191         muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
1192         int sock_fd;
1193         if (pc->cb_info == NULL) {
1194                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1195                 return CAMERA_ERROR_INVALID_PARAMETER;
1196         }
1197         sock_fd = pc->cb_info->fd;
1198         int get_width;
1199         int get_height;
1200
1201         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1202         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1203
1204         if (ret == CAMERA_ERROR_NONE) {
1205                 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1206                 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1207                 *width = get_width;
1208                 *height = get_height;
1209         }
1210         LOGD("ret : 0x%x", ret);
1211         return ret;
1212 }
1213
1214 int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
1215 {
1216         if( camera == NULL){
1217                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1218                 return CAMERA_ERROR_INVALID_PARAMETER;
1219         }
1220
1221         int ret = CAMERA_ERROR_NONE;
1222         camera_cli_s *pc = (camera_cli_s *)camera;
1223         muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
1224         int sock_fd;
1225         if (pc->cb_info == NULL) {
1226                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1227                 return CAMERA_ERROR_INVALID_PARAMETER;
1228         }
1229         sock_fd = pc->cb_info->fd;
1230         int set_rotation = (int)rotation;
1231
1232         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1233         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
1234         LOGD("ret : 0x%x", ret);
1235         return ret;
1236 }
1237
1238 int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
1239 {
1240         if( camera == NULL || rotation == NULL ){
1241                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1242                 return CAMERA_ERROR_INVALID_PARAMETER;
1243         }
1244
1245         int ret = CAMERA_ERROR_NONE;
1246
1247         camera_cli_s *pc = (camera_cli_s *)camera;
1248         muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
1249         int sock_fd;
1250         if (pc->cb_info == NULL) {
1251                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1252                 return CAMERA_ERROR_INVALID_PARAMETER;
1253         }
1254         sock_fd = pc->cb_info->fd;
1255         int get_rotation;
1256
1257         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1258         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1259
1260         if (ret == CAMERA_ERROR_NONE) {
1261                 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
1262                 *rotation = (camera_rotation_e)get_rotation;
1263         }
1264         LOGD("ret : 0x%x", ret);
1265         return ret;
1266 }
1267
1268 int camera_set_display_flip(camera_h camera, camera_flip_e flip)
1269 {
1270         if( camera == NULL){
1271                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1272                 return CAMERA_ERROR_INVALID_PARAMETER;
1273         }
1274
1275         int ret = CAMERA_ERROR_NONE;
1276
1277         camera_cli_s *pc = (camera_cli_s *)camera;
1278         muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
1279         int sock_fd;
1280         if (pc->cb_info == NULL) {
1281                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1282                 return CAMERA_ERROR_INVALID_PARAMETER;
1283         }
1284         sock_fd = pc->cb_info->fd;
1285         int set_flip = (int)flip;
1286
1287         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1288         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
1289         LOGD("ret : 0x%x", ret);
1290         return ret;
1291 }
1292
1293 int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
1294 {
1295         if( camera == NULL || flip == NULL ){
1296                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1297                 return CAMERA_ERROR_INVALID_PARAMETER;
1298         }
1299
1300         int ret = CAMERA_ERROR_NONE;
1301
1302         camera_cli_s *pc = (camera_cli_s *)camera;
1303         muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
1304         int sock_fd;
1305         if (pc->cb_info == NULL) {
1306                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1307                 return CAMERA_ERROR_INVALID_PARAMETER;
1308         }
1309         sock_fd = pc->cb_info->fd;
1310         int get_flip;
1311
1312         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1313         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1314
1315         if (ret == CAMERA_ERROR_NONE) {
1316                 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
1317                 *flip = (camera_flip_e)get_flip;
1318         }
1319         LOGD("ret : 0x%x", ret);
1320         return ret;
1321 }
1322
1323 int camera_set_display_visible(camera_h camera, bool visible)
1324 {
1325         if( camera == NULL){
1326                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1327                 return CAMERA_ERROR_INVALID_PARAMETER;
1328         }
1329
1330         int ret = CAMERA_ERROR_NONE;
1331
1332         camera_cli_s *pc = (camera_cli_s *)camera;
1333         muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
1334         int set_visible = (int)visible;
1335         int sock_fd;
1336         if (pc->cb_info == NULL) {
1337                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1338                 return CAMERA_ERROR_INVALID_PARAMETER;
1339         }
1340         sock_fd = pc->cb_info->fd;
1341
1342         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1343         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_visible);
1344         LOGD("ret : 0x%x", ret);
1345         return ret;
1346 }
1347
1348 int camera_is_display_visible(camera_h camera, bool* visible)
1349 {
1350         if( camera == NULL || visible == NULL){
1351                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1352                 return CAMERA_ERROR_INVALID_PARAMETER;
1353         }
1354
1355         int ret = CAMERA_ERROR_NONE;
1356
1357         camera_cli_s *pc = (camera_cli_s *)camera;
1358         muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
1359         int sock_fd;
1360         if (pc->cb_info == NULL) {
1361                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1362                 return CAMERA_ERROR_INVALID_PARAMETER;
1363         }
1364         sock_fd = pc->cb_info->fd;
1365         int get_visible;
1366
1367         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1368         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1369
1370         if (ret == CAMERA_ERROR_NONE) {
1371                 muse_camera_msg_get(get_visible, pc->cb_info->recvMsg);
1372                 *visible = (bool)get_visible;
1373         }
1374         LOGD("ret : 0x%x", ret);
1375         return ret;
1376 }
1377
1378 int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
1379 {
1380         if (camera == NULL) {
1381                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1382                 return CAMERA_ERROR_INVALID_PARAMETER;
1383         }
1384
1385         int ret = CAMERA_ERROR_NONE;
1386         int set_mode = (int)mode;
1387
1388         camera_cli_s *pc = (camera_cli_s *)camera;
1389         muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
1390         int sock_fd;
1391         if (pc->cb_info == NULL) {
1392                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1393                 return CAMERA_ERROR_INVALID_PARAMETER;
1394         }
1395         sock_fd = pc->cb_info->fd;
1396
1397         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1398         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
1399         LOGD("ret : 0x%x", ret);
1400         return ret;
1401 }
1402
1403 int camera_get_display_mode(camera_h camera, camera_display_mode_e* mode)
1404 {
1405         if( camera == NULL || mode == NULL){
1406                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1407                 return CAMERA_ERROR_INVALID_PARAMETER;
1408         }
1409
1410         int ret = CAMERA_ERROR_NONE;
1411
1412         camera_cli_s *pc = (camera_cli_s *)camera;
1413         muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
1414         int sock_fd;
1415         if (pc->cb_info == NULL) {
1416                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1417                 return CAMERA_ERROR_INVALID_PARAMETER;
1418         }
1419         sock_fd = pc->cb_info->fd;
1420         int get_mode;
1421
1422         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1423         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1424
1425         if (ret == CAMERA_ERROR_NONE) {
1426                 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
1427                 *mode = (camera_display_mode_e)get_mode;
1428         }
1429         LOGD("ret : 0x%x", ret);
1430         return ret;
1431 }
1432
1433 int camera_get_capture_resolution(camera_h camera, int *width, int *height)
1434 {
1435         if( camera == NULL || width== NULL || height == NULL){
1436                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1437                 return CAMERA_ERROR_INVALID_PARAMETER;
1438         }
1439         int ret = CAMERA_ERROR_NONE;
1440
1441         camera_cli_s *pc = (camera_cli_s *)camera;
1442         muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
1443         int sock_fd;
1444         if (pc->cb_info == NULL) {
1445                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1446                 return CAMERA_ERROR_INVALID_PARAMETER;
1447         }
1448         sock_fd = pc->cb_info->fd;
1449         int get_width;
1450         int get_height;
1451
1452         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1453         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1454
1455         if (ret == CAMERA_ERROR_NONE) {
1456                 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1457                 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1458                 *width = get_width;
1459                 *height = get_height;
1460         }
1461         LOGD("ret : 0x%x", ret);
1462         return ret;
1463 }
1464
1465 int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
1466 {
1467         if( camera == NULL || format == NULL){
1468                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1469                 return CAMERA_ERROR_INVALID_PARAMETER;
1470         }
1471         int ret = CAMERA_ERROR_NONE;
1472
1473         camera_cli_s *pc = (camera_cli_s *)camera;
1474         muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
1475         int get_format;
1476         int sock_fd;
1477         if (pc->cb_info == NULL) {
1478                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1479                 return CAMERA_ERROR_INVALID_PARAMETER;
1480         }
1481         sock_fd = pc->cb_info->fd;
1482
1483         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1484         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1485
1486         if (ret == CAMERA_ERROR_NONE) {
1487                 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1488                 *format = (camera_pixel_format_e)get_format;
1489         }
1490         LOGD("ret : 0x%x", ret);
1491         return ret;
1492 }
1493
1494 int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
1495 {
1496         if( camera == NULL || format == NULL){
1497                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1498                 return CAMERA_ERROR_INVALID_PARAMETER;
1499         }
1500
1501         int ret = CAMERA_ERROR_NONE;
1502
1503         camera_cli_s *pc = (camera_cli_s *)camera;
1504         muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
1505         int get_format;
1506         int sock_fd;
1507         if (pc->cb_info == NULL) {
1508                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1509                 return CAMERA_ERROR_INVALID_PARAMETER;
1510         }
1511         sock_fd = pc->cb_info->fd;
1512
1513         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1514         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1515
1516         if (ret == CAMERA_ERROR_NONE) {
1517                 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1518                 *format = (camera_pixel_format_e)get_format;
1519         }
1520         LOGD("ret : 0x%x", ret);
1521         return ret;
1522 }
1523
1524 int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void* user_data)
1525 {
1526         if (camera == NULL || callback == NULL) {
1527                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1528                 return CAMERA_ERROR_INVALID_PARAMETER;
1529         }
1530         int ret = CAMERA_ERROR_NONE;
1531
1532         camera_cli_s *pc = (camera_cli_s *)camera;
1533         int sock_fd;
1534         if (pc->cb_info == NULL) {
1535                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1536                 return CAMERA_ERROR_INVALID_PARAMETER;
1537         }
1538         sock_fd = pc->cb_info->fd;
1539         muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
1540
1541         LOGD("Enter, handle :%x", pc->remote_handle);
1542
1543         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = callback;
1544         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = user_data;
1545
1546         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1547         LOGD("ret : 0x%x", ret);
1548         return ret;
1549 }
1550
1551 int camera_unset_preview_cb(camera_h camera)
1552 {
1553         if (camera == NULL) {
1554                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1555                 return CAMERA_ERROR_INVALID_PARAMETER;
1556         }
1557
1558         int ret = CAMERA_ERROR_NONE;
1559
1560         camera_cli_s *pc = (camera_cli_s *)camera;
1561         muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
1562
1563         LOGD("Enter, handle :%x", pc->remote_handle);
1564
1565         int sock_fd;
1566         if (pc->cb_info == NULL) {
1567                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1568                 return CAMERA_ERROR_INVALID_PARAMETER;
1569         }
1570         sock_fd = pc->cb_info->fd;
1571         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1572         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1573
1574         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1575         LOGD("ret : 0x%x", ret);
1576         return ret;
1577 }
1578
1579 int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void* user_data)
1580 {
1581         if (camera == NULL) {
1582                 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
1583                 return CAMERA_ERROR_INVALID_PARAMETER;
1584         }
1585
1586         if (callback == NULL) {
1587                 LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
1588                 return CAMERA_ERROR_NOT_SUPPORTED;
1589         }
1590
1591         int ret = CAMERA_ERROR_NONE;
1592
1593         camera_cli_s *pc = (camera_cli_s *)camera;
1594         muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
1595
1596         LOGD("Enter, handle :%x", pc->remote_handle);
1597
1598         int sock_fd;
1599         if (pc->cb_info == NULL) {
1600                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1601                 return CAMERA_ERROR_INVALID_PARAMETER;
1602         }
1603         sock_fd = pc->cb_info->fd;
1604         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = callback;
1605         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = user_data;
1606
1607         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1608         LOGD("ret : 0x%x", ret);
1609         return ret;
1610 }
1611
1612 int camera_unset_media_packet_preview_cb(camera_h camera)
1613 {
1614         if (camera == NULL) {
1615                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1616                 return CAMERA_ERROR_INVALID_PARAMETER;
1617         }
1618
1619         int ret = CAMERA_ERROR_NONE;
1620
1621         camera_cli_s *pc = (camera_cli_s *)camera;
1622         muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
1623
1624         LOGD("Enter, handle :%x", pc->remote_handle);
1625
1626         int sock_fd;
1627         if (pc->cb_info == NULL) {
1628                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1629                 return CAMERA_ERROR_INVALID_PARAMETER;
1630         }
1631         sock_fd = pc->cb_info->fd;
1632         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1633         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1634
1635         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1636         LOGD("ret : 0x%x", ret);
1637         return ret;
1638 }
1639
1640 int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void* user_data)
1641 {
1642         if( camera == NULL || callback == NULL){
1643                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1644                 return CAMERA_ERROR_INVALID_PARAMETER;
1645         }
1646         int ret = CAMERA_ERROR_NONE;
1647
1648         camera_cli_s *pc = (camera_cli_s *)camera;
1649         muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
1650
1651         LOGD("Enter, handle :%x", pc->remote_handle);
1652
1653         int sock_fd;
1654         if (pc->cb_info == NULL) {
1655                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1656                 return CAMERA_ERROR_INVALID_PARAMETER;
1657         }
1658         sock_fd = pc->cb_info->fd;
1659         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = callback;
1660         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = user_data;
1661
1662         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1663         LOGD("ret : 0x%x", ret);
1664         return ret;
1665 }
1666 int camera_unset_state_changed_cb(camera_h camera)
1667 {
1668         if( camera == NULL){
1669                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1670                 return CAMERA_ERROR_INVALID_PARAMETER;
1671         }
1672         int ret = CAMERA_ERROR_NONE;
1673
1674         camera_cli_s *pc = (camera_cli_s *)camera;
1675         muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
1676
1677         LOGD("Enter, handle :%x", pc->remote_handle);
1678
1679         int sock_fd;
1680         if (pc->cb_info == NULL) {
1681                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1682                 return CAMERA_ERROR_INVALID_PARAMETER;
1683         }
1684         sock_fd = pc->cb_info->fd;
1685         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1686         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1687
1688         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1689         LOGD("ret : 0x%x", ret);
1690         return ret;
1691 }
1692
1693 int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
1694 {
1695         if( camera == NULL || callback == NULL){
1696                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1697                 return CAMERA_ERROR_INVALID_PARAMETER;
1698         }
1699         int ret = CAMERA_ERROR_NONE;
1700
1701         camera_cli_s *pc = (camera_cli_s *)camera;
1702         muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
1703
1704         LOGD("Enter, handle :%x", pc->remote_handle);
1705
1706         int sock_fd;
1707         if (pc->cb_info == NULL) {
1708                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1709                 return CAMERA_ERROR_INVALID_PARAMETER;
1710         }
1711         sock_fd = pc->cb_info->fd;
1712         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = callback;
1713         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = user_data;
1714
1715         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1716         LOGD("ret : 0x%x", ret);
1717         return ret;
1718 }
1719
1720 int camera_unset_interrupted_cb(camera_h camera)
1721 {
1722         if( camera == NULL){
1723                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1724                 return CAMERA_ERROR_INVALID_PARAMETER;
1725         }
1726         int ret = CAMERA_ERROR_NONE;
1727
1728         camera_cli_s *pc = (camera_cli_s *)camera;
1729         muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
1730
1731         LOGD("Enter, handle :%x", pc->remote_handle);
1732
1733         int sock_fd;
1734         if (pc->cb_info == NULL) {
1735                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1736                 return CAMERA_ERROR_INVALID_PARAMETER;
1737         }
1738         sock_fd = pc->cb_info->fd;
1739         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1740         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1741
1742         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1743         LOGD("ret : 0x%x", ret);
1744         return ret;
1745 }
1746
1747 int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void* user_data)
1748 {
1749         if( camera == NULL || callback == NULL){
1750                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1751                 return CAMERA_ERROR_INVALID_PARAMETER;
1752         }
1753         int ret = CAMERA_ERROR_NONE;
1754
1755         camera_cli_s *pc = (camera_cli_s *)camera;
1756         muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
1757
1758         LOGD("Enter, handle :%x", pc->remote_handle);
1759
1760         int sock_fd;
1761         if (pc->cb_info == NULL) {
1762                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1763                 return CAMERA_ERROR_INVALID_PARAMETER;
1764         }
1765         sock_fd = pc->cb_info->fd;
1766         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = callback;
1767         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = user_data;
1768
1769         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1770         LOGD("ret : 0x%x", ret);
1771         return ret;
1772 }
1773
1774 int camera_unset_focus_changed_cb(camera_h camera)
1775 {
1776         if( camera == NULL){
1777                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1778                 return CAMERA_ERROR_INVALID_PARAMETER;
1779         }
1780         int ret = CAMERA_ERROR_NONE;
1781
1782         camera_cli_s *pc = (camera_cli_s *)camera;
1783         muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
1784
1785         LOGD("Enter, handle :%x", pc->remote_handle);
1786
1787         int sock_fd;
1788         if (pc->cb_info == NULL) {
1789                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1790                 return CAMERA_ERROR_INVALID_PARAMETER;
1791         }
1792         sock_fd = pc->cb_info->fd;
1793         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1794         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1795
1796         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1797         LOGD("ret : 0x%x", ret);
1798         return ret;
1799 }
1800
1801 int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
1802 {
1803         if( camera == NULL || callback == NULL){
1804                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1805                 return CAMERA_ERROR_INVALID_PARAMETER;
1806         }
1807         int ret = CAMERA_ERROR_NONE;
1808
1809         camera_cli_s *pc = (camera_cli_s *)camera;
1810         muse_camera_api_e api = MUSE_CAMERA_API_SET_ERROR_CB;
1811
1812         LOGD("Enter, handle :%x", pc->remote_handle);
1813
1814         int sock_fd;
1815         if (pc->cb_info == NULL) {
1816                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1817                 return CAMERA_ERROR_INVALID_PARAMETER;
1818         }
1819         sock_fd = pc->cb_info->fd;
1820         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = callback;
1821         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = user_data;
1822
1823         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1824         LOGD("ret : 0x%x", ret);
1825         return ret;
1826 }
1827
1828 int camera_unset_error_cb(camera_h camera)
1829 {
1830         if( camera == NULL){
1831                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1832                 return CAMERA_ERROR_INVALID_PARAMETER;
1833         }
1834         int ret = CAMERA_ERROR_NONE;
1835
1836         camera_cli_s *pc = (camera_cli_s *)camera;
1837         muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
1838
1839         LOGD("Enter, handle :%x", pc->remote_handle);
1840
1841         int sock_fd;
1842         if (pc->cb_info == NULL) {
1843                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1844                 return CAMERA_ERROR_INVALID_PARAMETER;
1845         }
1846         sock_fd = pc->cb_info->fd;
1847         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1848         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1849
1850         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1851         LOGD("ret : 0x%x", ret);
1852         return ret;
1853 }
1854
1855 int camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb , void *user_data)
1856 {
1857         if( camera == NULL || foreach_cb == NULL){
1858                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1859                 return CAMERA_ERROR_INVALID_PARAMETER;
1860         }
1861         int ret = CAMERA_ERROR_NONE;
1862
1863         camera_cli_s *pc = (camera_cli_s *)camera;
1864         muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
1865
1866         LOGD("Enter, handle :%x", pc->remote_handle);
1867
1868         int sock_fd;
1869         if (pc->cb_info == NULL) {
1870                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1871                 return CAMERA_ERROR_INVALID_PARAMETER;
1872         }
1873         sock_fd = pc->cb_info->fd;
1874         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
1875         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
1876
1877         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1878         LOGD("ret : 0x%x", ret);
1879         return ret;
1880 }
1881
1882 int camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb , void *user_data)
1883 {
1884         if( camera == NULL || foreach_cb == NULL){
1885                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1886                 return CAMERA_ERROR_INVALID_PARAMETER;
1887         }
1888         int ret = CAMERA_ERROR_NONE;
1889
1890         camera_cli_s *pc = (camera_cli_s *)camera;
1891         muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
1892
1893         LOGD("Enter, handle :%x", pc->remote_handle);
1894
1895         int sock_fd;
1896         if (pc->cb_info == NULL) {
1897                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1898                 return CAMERA_ERROR_INVALID_PARAMETER;
1899         }
1900         sock_fd = pc->cb_info->fd;
1901         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
1902         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
1903
1904         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1905         LOGD("ret : 0x%x", ret);
1906         return ret;
1907 }
1908
1909 int camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb , void *user_data)
1910 {
1911         if( camera == NULL || foreach_cb == NULL){
1912                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1913                 return CAMERA_ERROR_INVALID_PARAMETER;
1914         }
1915         int ret = CAMERA_ERROR_NONE;
1916
1917         camera_cli_s *pc = (camera_cli_s *)camera;
1918         muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
1919
1920         LOGD("Enter, handle :%x", pc->remote_handle);
1921
1922         int sock_fd;
1923         if (pc->cb_info == NULL) {
1924                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1925                 return CAMERA_ERROR_INVALID_PARAMETER;
1926         }
1927         sock_fd = pc->cb_info->fd;
1928         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
1929         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
1930
1931         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1932         LOGD("ret : 0x%x", ret);
1933         return ret;
1934 }
1935
1936
1937 int camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb , void *user_data)
1938 {
1939         if( camera == NULL || foreach_cb == NULL){
1940                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1941                 return CAMERA_ERROR_INVALID_PARAMETER;
1942         }
1943         int ret = CAMERA_ERROR_NONE;
1944
1945         camera_cli_s *pc = (camera_cli_s *)camera;
1946         muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
1947
1948         LOGD("Enter, handle :%x", pc->remote_handle);
1949
1950         int sock_fd;
1951         if (pc->cb_info == NULL) {
1952                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1953                 return CAMERA_ERROR_INVALID_PARAMETER;
1954         }
1955         sock_fd = pc->cb_info->fd;
1956         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
1957         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
1958
1959         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1960         LOGD("ret : 0x%x", ret);
1961         return ret;
1962 }
1963
1964
1965 int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
1966 {
1967         if (camera == NULL || width == NULL || height == NULL) {
1968                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1969                 return CAMERA_ERROR_INVALID_PARAMETER;
1970         }
1971         int ret = CAMERA_ERROR_NONE;
1972
1973         camera_cli_s *pc = (camera_cli_s *)camera;
1974         muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
1975         int sock_fd;
1976         if (pc->cb_info == NULL) {
1977                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1978                 return CAMERA_ERROR_INVALID_PARAMETER;
1979         }
1980         sock_fd = pc->cb_info->fd;
1981         int get_width;
1982         int get_height;
1983
1984         LOGD("Enter, remote_handle : %x", pc->remote_handle);
1985         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1986
1987         if (ret == CAMERA_ERROR_NONE) {
1988                 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1989                 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1990                 *width = get_width;
1991                 *height = get_height;
1992         }
1993         LOGD("ret : 0x%x", ret);
1994         return ret;
1995 }
1996
1997
1998 int camera_attr_get_lens_orientation(camera_h camera, int *angle)
1999 {
2000         if( camera == NULL || angle == NULL){
2001                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2002                 return CAMERA_ERROR_INVALID_PARAMETER;
2003         }
2004         int ret = CAMERA_ERROR_NONE;
2005
2006         camera_cli_s *pc = (camera_cli_s *)camera;
2007         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
2008         int sock_fd;
2009         if (pc->cb_info == NULL) {
2010                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2011                 return CAMERA_ERROR_INVALID_PARAMETER;
2012         }
2013         sock_fd = pc->cb_info->fd;
2014         int get_angle;
2015
2016         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2017         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2018
2019         if (ret == CAMERA_ERROR_NONE) {
2020                 muse_camera_msg_get(get_angle, pc->cb_info->recvMsg);
2021                 *angle = get_angle;
2022         }
2023         LOGD("ret : 0x%x", ret);
2024         return ret;
2025 }
2026
2027 int camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
2028 {
2029         if (camera == NULL) {
2030                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2031                 return CAMERA_ERROR_INVALID_PARAMETER;
2032         }
2033         int ret = CAMERA_ERROR_NONE;
2034         camera_cli_s *pc = (camera_cli_s *)camera;
2035         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
2036         int sock_fd;
2037         if (pc->cb_info == NULL) {
2038                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2039                 return CAMERA_ERROR_INVALID_PARAMETER;
2040         }
2041         sock_fd = pc->cb_info->fd;
2042         int set_mode = (int)mode;
2043         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2044         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2045         LOGD("ret : 0x%x", ret);
2046         return ret;
2047 }
2048
2049 int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
2050 {
2051         if (camera == NULL || mode == NULL) {
2052                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2053                 return CAMERA_ERROR_INVALID_PARAMETER;
2054         }
2055
2056         int ret = CAMERA_ERROR_NONE;
2057         camera_cli_s *pc = (camera_cli_s *)camera;
2058         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
2059         int sock_fd;
2060         if (pc->cb_info == NULL) {
2061                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2062                 return CAMERA_ERROR_INVALID_PARAMETER;
2063         }
2064         sock_fd = pc->cb_info->fd;
2065         int get_mode;
2066         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2067         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2068
2069         if (ret == CAMERA_ERROR_NONE) {
2070                 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2071                 *mode = (camera_attr_theater_mode_e)get_mode;
2072         }
2073         LOGD("ret : 0x%x", ret);
2074         return ret;
2075 }
2076
2077 int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
2078 {
2079         if (camera == NULL || foreach_cb == NULL) {
2080                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2081                 return CAMERA_ERROR_INVALID_PARAMETER;
2082         }
2083         int ret = CAMERA_ERROR_NONE;
2084
2085         camera_cli_s *pc = (camera_cli_s *)camera;
2086         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE;
2087
2088         LOGD("Enter, handle :%x", pc->remote_handle);
2089
2090         int sock_fd;
2091         if (pc->cb_info == NULL) {
2092                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2093                 return CAMERA_ERROR_INVALID_PARAMETER;
2094         }
2095         sock_fd = pc->cb_info->fd;
2096         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
2097         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
2098
2099         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2100
2101         LOGD("Finish, return :%x", ret);
2102
2103         return ret;
2104 }
2105
2106 int camera_attr_set_preview_fps(camera_h camera,  camera_attr_fps_e fps)
2107 {
2108         if( camera == NULL){
2109                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2110                 return CAMERA_ERROR_INVALID_PARAMETER;
2111         }
2112         int ret = CAMERA_ERROR_NONE;
2113         camera_cli_s *pc = (camera_cli_s *)camera;
2114         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
2115         int sock_fd;
2116         if (pc->cb_info == NULL) {
2117                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2118                 return CAMERA_ERROR_INVALID_PARAMETER;
2119         }
2120         sock_fd = pc->cb_info->fd;
2121         int set_fps = (int)fps;
2122         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2123         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_fps);
2124         LOGD("ret : 0x%x", ret);
2125         return ret;
2126 }
2127
2128
2129 int camera_attr_set_image_quality(camera_h camera,  int quality)
2130 {
2131         if( camera == NULL){
2132                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2133                 return CAMERA_ERROR_INVALID_PARAMETER;
2134         }
2135         int ret = CAMERA_ERROR_NONE;
2136
2137         camera_cli_s *pc = (camera_cli_s *)camera;
2138         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
2139         int sock_fd;
2140         if (pc->cb_info == NULL) {
2141                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2142                 return CAMERA_ERROR_INVALID_PARAMETER;
2143         }
2144         sock_fd = pc->cb_info->fd;
2145         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2146         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, quality);
2147         LOGD("ret : 0x%x", ret);
2148         return ret;
2149 }
2150
2151 int camera_attr_get_preview_fps(camera_h camera,  camera_attr_fps_e *fps)
2152 {
2153         if( camera == NULL || fps == NULL){
2154                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2155                 return CAMERA_ERROR_INVALID_PARAMETER;
2156         }
2157         int ret = CAMERA_ERROR_NONE;
2158
2159         camera_cli_s *pc = (camera_cli_s *)camera;
2160         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
2161         int get_fps;
2162         int sock_fd;
2163         if (pc->cb_info == NULL) {
2164                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2165                 return CAMERA_ERROR_INVALID_PARAMETER;
2166         }
2167         sock_fd = pc->cb_info->fd;
2168
2169         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2170         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2171
2172         if (ret == CAMERA_ERROR_NONE) {
2173                 muse_camera_msg_get(get_fps, pc->cb_info->recvMsg);
2174                 *fps = (camera_attr_fps_e)get_fps;
2175         }
2176         LOGD("ret : 0x%x", ret);
2177         return ret;
2178 }
2179
2180
2181 int camera_attr_get_image_quality(camera_h camera, int *quality)
2182 {
2183         if( camera == NULL || quality == NULL){
2184                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2185                 return CAMERA_ERROR_INVALID_PARAMETER;
2186         }
2187         int ret = CAMERA_ERROR_NONE;
2188
2189         camera_cli_s *pc = (camera_cli_s *)camera;
2190         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
2191         int sock_fd;
2192         if (pc->cb_info == NULL) {
2193                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2194                 return CAMERA_ERROR_INVALID_PARAMETER;
2195         }
2196         sock_fd = pc->cb_info->fd;
2197         int get_quality;
2198         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2199         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2200
2201         if (ret == CAMERA_ERROR_NONE) {
2202                 muse_camera_msg_get(get_quality, pc->cb_info->recvMsg);
2203                 *quality = get_quality;
2204         }
2205         LOGD("ret : 0x%x", ret);
2206         return ret;
2207 }
2208
2209
2210 int camera_attr_set_zoom(camera_h camera, int zoom)
2211 {
2212         if( camera == NULL){
2213                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2214                 return CAMERA_ERROR_INVALID_PARAMETER;
2215         }
2216         int ret = CAMERA_ERROR_NONE;
2217
2218         camera_cli_s *pc = (camera_cli_s *)camera;
2219         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
2220         int sock_fd;
2221         if (pc->cb_info == NULL) {
2222                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2223                 return CAMERA_ERROR_INVALID_PARAMETER;
2224         }
2225         sock_fd = pc->cb_info->fd;
2226
2227         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2228         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, zoom);
2229         LOGD("ret : 0x%x", ret);
2230         return ret;
2231 }
2232
2233 int camera_attr_set_af_mode(camera_h camera,  camera_attr_af_mode_e mode)
2234 {
2235         if( camera == NULL){
2236                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2237                 return CAMERA_ERROR_INVALID_PARAMETER;
2238         }
2239         int ret = CAMERA_ERROR_NONE;
2240
2241         camera_cli_s *pc = (camera_cli_s *)camera;
2242         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
2243         int sock_fd;
2244         if (pc->cb_info == NULL) {
2245                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2246                 return CAMERA_ERROR_INVALID_PARAMETER;
2247         }
2248         sock_fd = pc->cb_info->fd;
2249         int set_mode = (int)mode;
2250         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2251         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2252         LOGD("ret : 0x%x", ret);
2253         return ret;
2254 }
2255
2256 int camera_attr_set_af_area(camera_h camera, int x, int y)
2257 {
2258         if( camera == NULL){
2259                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2260                 return CAMERA_ERROR_INVALID_PARAMETER;
2261         }
2262         int ret = CAMERA_ERROR_NONE;
2263         camera_cli_s *pc = (camera_cli_s *)camera;
2264         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
2265         int sock_fd = pc->cb_info->fd;
2266         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2267         muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, x, INT, y);
2268         LOGD("ret : 0x%x", ret);
2269         return ret;
2270 }
2271
2272
2273 int camera_attr_clear_af_area(camera_h camera)
2274 {
2275         if( camera == NULL){
2276                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2277                 return CAMERA_ERROR_INVALID_PARAMETER;
2278         }
2279         int ret = CAMERA_ERROR_NONE;
2280
2281         camera_cli_s *pc = (camera_cli_s *)camera;
2282         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA;
2283         int sock_fd;
2284         if (pc->cb_info == NULL) {
2285                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2286                 return CAMERA_ERROR_INVALID_PARAMETER;
2287         }
2288         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);
2291         LOGD("ret : 0x%x", ret);
2292         return ret;
2293 }
2294
2295
2296 int camera_attr_set_exposure_mode(camera_h camera,  camera_attr_exposure_mode_e mode)
2297 {
2298         if( camera == NULL){
2299                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2300                 return CAMERA_ERROR_INVALID_PARAMETER;
2301         }
2302
2303         if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
2304                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
2305                 return CAMERA_ERROR_NOT_SUPPORTED;
2306         }
2307
2308         int ret = CAMERA_ERROR_NONE;
2309         camera_cli_s *pc = (camera_cli_s *)camera;
2310         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
2311         int set_mode = (int)mode;
2312         int sock_fd;
2313         if (pc->cb_info == NULL) {
2314                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2315                 return CAMERA_ERROR_INVALID_PARAMETER;
2316         }
2317         sock_fd = pc->cb_info->fd;
2318         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2319         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2320         LOGD("ret : 0x%x", ret);
2321         return ret;
2322 }
2323
2324
2325 int camera_attr_set_exposure(camera_h camera, int value)
2326 {
2327         if( camera == NULL){
2328                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2329                 return CAMERA_ERROR_INVALID_PARAMETER;
2330         }
2331         int ret = CAMERA_ERROR_NONE;
2332
2333         camera_cli_s *pc = (camera_cli_s *)camera;
2334         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
2335         int sock_fd;
2336         if (pc->cb_info == NULL) {
2337                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2338                 return CAMERA_ERROR_INVALID_PARAMETER;
2339         }
2340         sock_fd = pc->cb_info->fd;
2341
2342         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2343         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, value);
2344         LOGD("ret : 0x%x", ret);
2345         return ret;
2346 }
2347
2348
2349 int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
2350 {
2351         if( camera == NULL){
2352                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2353                 return CAMERA_ERROR_INVALID_PARAMETER;
2354         }
2355         int ret = CAMERA_ERROR_NONE;
2356
2357         camera_cli_s *pc = (camera_cli_s *)camera;
2358         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
2359         int sock_fd;
2360         if (pc->cb_info == NULL) {
2361                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2362                 return CAMERA_ERROR_INVALID_PARAMETER;
2363         }
2364         sock_fd = pc->cb_info->fd;
2365         int set_iso = (int)iso;
2366         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2367         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_iso);
2368         LOGD("ret : 0x%x", ret);
2369         return ret;
2370 }
2371
2372
2373 int camera_attr_set_brightness(camera_h camera, int level)
2374 {
2375         if( camera == NULL){
2376                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2377                 return CAMERA_ERROR_INVALID_PARAMETER;
2378         }
2379         int ret = CAMERA_ERROR_NONE;
2380
2381         camera_cli_s *pc = (camera_cli_s *)camera;
2382         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
2383         int sock_fd;
2384         if (pc->cb_info == NULL) {
2385                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2386                 return CAMERA_ERROR_INVALID_PARAMETER;
2387         }
2388         sock_fd = pc->cb_info->fd;
2389
2390         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2391         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2392         LOGD("ret : 0x%x", ret);
2393         return ret;
2394 }
2395
2396
2397 int camera_attr_set_contrast(camera_h camera, int level)
2398 {
2399         if( camera == NULL){
2400                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2401                 return CAMERA_ERROR_INVALID_PARAMETER;
2402         }
2403         int ret = CAMERA_ERROR_NONE;
2404
2405         camera_cli_s *pc = (camera_cli_s *)camera;
2406         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_CONTRAST;
2407         int sock_fd;
2408         if (pc->cb_info == NULL) {
2409                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2410                 return CAMERA_ERROR_INVALID_PARAMETER;
2411         }
2412         sock_fd = pc->cb_info->fd;
2413
2414         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2415         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2416         LOGD("ret : 0x%x", ret);
2417         return ret;
2418 }
2419
2420
2421 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
2422 {
2423         if (camera == NULL) {
2424                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2425                 return CAMERA_ERROR_INVALID_PARAMETER;
2426         }
2427
2428         if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
2429                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_NOT_SUPPORTED);
2430                 return CAMERA_ERROR_NOT_SUPPORTED;
2431         }
2432
2433         int ret = CAMERA_ERROR_NONE;
2434
2435         camera_cli_s *pc = (camera_cli_s *)camera;
2436         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
2437         int sock_fd;
2438         if (pc->cb_info == NULL) {
2439                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2440                 return CAMERA_ERROR_INVALID_PARAMETER;
2441         }
2442         sock_fd = pc->cb_info->fd;
2443         int set_whitebalance = (int)wb;
2444         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2445         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_whitebalance);
2446         LOGD("ret : 0x%x", ret);
2447         return ret;
2448 }
2449
2450
2451 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
2452 {
2453         if( camera == NULL){
2454                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2455                 return CAMERA_ERROR_INVALID_PARAMETER;
2456         }
2457         int ret = CAMERA_ERROR_NONE;
2458
2459         camera_cli_s *pc = (camera_cli_s *)camera;
2460         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
2461         int sock_fd;
2462         if (pc->cb_info == NULL) {
2463                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2464                 return CAMERA_ERROR_INVALID_PARAMETER;
2465         }
2466         sock_fd = pc->cb_info->fd;
2467         int set_effect = (int)effect;
2468         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2469         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_effect);
2470         LOGD("ret : 0x%x", ret);
2471         return ret;
2472 }
2473
2474
2475 int camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
2476 {
2477         if( camera == NULL){
2478                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2479                 return CAMERA_ERROR_INVALID_PARAMETER;
2480         }
2481         int ret = CAMERA_ERROR_NONE;
2482
2483         camera_cli_s *pc = (camera_cli_s *)camera;
2484         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
2485         int sock_fd;
2486         if (pc->cb_info == NULL) {
2487                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2488                 return CAMERA_ERROR_INVALID_PARAMETER;
2489         }
2490         sock_fd = pc->cb_info->fd;
2491         int set_mode = (int)mode;
2492         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2493         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2494         LOGD("ret : 0x%x", ret);
2495         return ret;
2496 }
2497
2498
2499 int camera_attr_enable_tag(camera_h camera, bool enable)
2500 {
2501         if( camera == NULL){
2502                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2503                 return CAMERA_ERROR_INVALID_PARAMETER;
2504         }
2505         int ret = CAMERA_ERROR_NONE;
2506         camera_cli_s *pc = (camera_cli_s *)camera;
2507         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
2508         int sock_fd;
2509         if (pc->cb_info == NULL) {
2510                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2511                 return CAMERA_ERROR_INVALID_PARAMETER;
2512         }
2513         sock_fd = pc->cb_info->fd;
2514         int set_enable = (int)enable;
2515
2516         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2517         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
2518         LOGD("ret : 0x%x", ret);
2519         return ret;
2520 }
2521
2522
2523 int camera_attr_set_tag_image_description(camera_h camera, const char *description)
2524 {
2525         if( camera == NULL){
2526                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2527                 return CAMERA_ERROR_INVALID_PARAMETER;
2528         }
2529         if( description == NULL){
2530                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2531                 return CAMERA_ERROR_INVALID_PARAMETER;
2532         }
2533         int ret = CAMERA_ERROR_NONE;
2534         camera_cli_s *pc = (camera_cli_s *)camera;
2535         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
2536         int sock_fd;
2537         if (pc->cb_info == NULL) {
2538                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2539                 return CAMERA_ERROR_INVALID_PARAMETER;
2540         }
2541         sock_fd = pc->cb_info->fd;
2542         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2543         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, description);
2544         LOGD("ret : 0x%x", ret);
2545         return ret;
2546 }
2547
2548
2549 int camera_attr_set_tag_orientation(camera_h camera,  camera_attr_tag_orientation_e orientation)
2550 {
2551         if( camera == NULL){
2552                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2553                 return CAMERA_ERROR_INVALID_PARAMETER;
2554         }
2555         int ret = CAMERA_ERROR_NONE;
2556         camera_cli_s *pc = (camera_cli_s *)camera;
2557         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
2558         int sock_fd;
2559         if (pc->cb_info == NULL) {
2560                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2561                 return CAMERA_ERROR_INVALID_PARAMETER;
2562         }
2563         sock_fd = pc->cb_info->fd;
2564         int set_orientation = (int)orientation;
2565
2566         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2567         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_orientation);
2568         LOGD("ret : 0x%x", ret);
2569         return ret;
2570 }
2571
2572
2573 int camera_attr_set_tag_software(camera_h camera,  const char *software)
2574 {
2575         if( camera == NULL){
2576                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2577                 return CAMERA_ERROR_INVALID_PARAMETER;
2578         }
2579         if( software == NULL){
2580                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2581                 return CAMERA_ERROR_INVALID_PARAMETER;
2582         }
2583         int ret = CAMERA_ERROR_NONE;
2584         camera_cli_s *pc = (camera_cli_s *)camera;
2585         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
2586         int sock_fd;
2587         if (pc->cb_info == NULL) {
2588                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2589                 return CAMERA_ERROR_INVALID_PARAMETER;
2590         }
2591         sock_fd = pc->cb_info->fd;
2592         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2593         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, software);
2594         LOGD("ret : 0x%x", ret);
2595         return ret;
2596 }
2597
2598
2599 int camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
2600 {
2601         if( camera == NULL){
2602                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2603                 return CAMERA_ERROR_INVALID_PARAMETER;
2604         }
2605         int ret = CAMERA_ERROR_NONE;
2606         camera_cli_s *pc = (camera_cli_s *)camera;
2607         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
2608         int sock_fd;
2609         if (pc->cb_info == NULL) {
2610                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2611                 return CAMERA_ERROR_INVALID_PARAMETER;
2612         }
2613         sock_fd = pc->cb_info->fd;
2614         double set_geotag[3] = { latitude, longitude, altitude };
2615
2616         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2617         muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
2618                                                                         set_geotag, sizeof(set_geotag), sizeof(double));
2619         LOGD("ret : 0x%x", ret);
2620         return ret;
2621 }
2622
2623
2624 int camera_attr_remove_geotag(camera_h camera)
2625 {
2626         if( camera == NULL){
2627                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2628                 return CAMERA_ERROR_INVALID_PARAMETER;
2629         }
2630         int ret = CAMERA_ERROR_NONE;
2631         camera_cli_s *pc = (camera_cli_s *)camera;
2632         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
2633         int sock_fd;
2634         if (pc->cb_info == NULL) {
2635                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2636                 return CAMERA_ERROR_INVALID_PARAMETER;
2637         }
2638         sock_fd = pc->cb_info->fd;
2639         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2640         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2641         LOGD("ret : 0x%x", ret);
2642         return ret;
2643 }
2644
2645
2646 int camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
2647 {
2648         if( camera == NULL){
2649                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2650                 return CAMERA_ERROR_INVALID_PARAMETER;
2651         }
2652         int ret = CAMERA_ERROR_NONE;
2653         camera_cli_s *pc = (camera_cli_s *)camera;
2654         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
2655         int sock_fd;
2656         if (pc->cb_info == NULL) {
2657                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2658                 return CAMERA_ERROR_INVALID_PARAMETER;
2659         }
2660         sock_fd = pc->cb_info->fd;
2661         int set_mode = (int)mode;
2662
2663         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2664         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2665         LOGD("ret : 0x%x", ret);
2666         return ret;
2667 }
2668
2669
2670 int camera_attr_get_zoom(camera_h camera, int *zoom)
2671 {
2672         if( camera == NULL || zoom == NULL){
2673                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2674                 return CAMERA_ERROR_INVALID_PARAMETER;
2675         }
2676         int ret = CAMERA_ERROR_NONE;
2677
2678         camera_cli_s *pc = (camera_cli_s *)camera;
2679         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
2680         int get_zoom;
2681         int sock_fd;
2682         if (pc->cb_info == NULL) {
2683                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2684                 return CAMERA_ERROR_INVALID_PARAMETER;
2685         }
2686         sock_fd = pc->cb_info->fd;
2687
2688         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2689         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2690
2691         if (ret == CAMERA_ERROR_NONE) {
2692                 muse_camera_msg_get(get_zoom, pc->cb_info->recvMsg);
2693                 *zoom = get_zoom;
2694         }
2695         LOGD("ret : 0x%x", ret);
2696         return ret;
2697 }
2698
2699
2700 int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
2701 {
2702         if( camera == NULL || min == NULL || max == NULL ){
2703                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2704                 return CAMERA_ERROR_INVALID_PARAMETER;
2705         }
2706         int ret = CAMERA_ERROR_NONE;
2707         camera_cli_s *pc = (camera_cli_s *)camera;
2708         int sock_fd;
2709         if (pc->cb_info == NULL) {
2710                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2711                 return CAMERA_ERROR_INVALID_PARAMETER;
2712         }
2713         sock_fd = pc->cb_info->fd;
2714         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
2715         int get_min;
2716         int get_max;
2717
2718         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2719         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2720
2721         if (ret == CAMERA_ERROR_NONE) {
2722                 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2723                 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2724                 *min = get_min;
2725                 *max = get_max;
2726         }
2727         LOGD("ret : 0x%x", ret);
2728         return ret;
2729 }
2730
2731
2732 int camera_attr_get_af_mode( camera_h camera,  camera_attr_af_mode_e *mode)
2733 {
2734         if( camera == NULL || mode == NULL){
2735                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2736                 return CAMERA_ERROR_INVALID_PARAMETER;
2737         }
2738         int ret = CAMERA_ERROR_NONE;
2739         camera_cli_s *pc = (camera_cli_s *)camera;
2740         int sock_fd;
2741         if (pc->cb_info == NULL) {
2742                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2743                 return CAMERA_ERROR_INVALID_PARAMETER;
2744         }
2745         sock_fd = pc->cb_info->fd;
2746         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
2747         int get_mode;
2748
2749         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2750         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2751
2752         if (ret == CAMERA_ERROR_NONE) {
2753                 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2754                 *mode = (camera_attr_af_mode_e)get_mode;
2755         }
2756         LOGD("ret : 0x%x", ret);
2757         return ret;
2758 }
2759
2760
2761 int camera_attr_get_exposure_mode( camera_h camera, camera_attr_exposure_mode_e *mode)
2762 {
2763         if( camera == NULL|| mode == NULL){
2764                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2765                 return CAMERA_ERROR_INVALID_PARAMETER;
2766         }
2767         int ret = CAMERA_ERROR_NONE;
2768         camera_cli_s *pc = (camera_cli_s *)camera;
2769         int sock_fd;
2770         if (pc->cb_info == NULL) {
2771                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2772                 return CAMERA_ERROR_INVALID_PARAMETER;
2773         }
2774         sock_fd = pc->cb_info->fd;
2775         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
2776         int get_mode;
2777
2778         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2779         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2780
2781         if (ret == CAMERA_ERROR_NONE) {
2782                 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2783                 *mode = (camera_attr_exposure_mode_e)get_mode;
2784         }
2785         LOGD("ret : 0x%x", ret);
2786         return ret;
2787 }
2788
2789 int camera_attr_get_exposure(camera_h camera, int *value)
2790 {
2791         if( camera == NULL || value == NULL){
2792                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2793                 return CAMERA_ERROR_INVALID_PARAMETER;
2794         }
2795         int ret = CAMERA_ERROR_NONE;
2796         camera_cli_s *pc = (camera_cli_s *)camera;
2797         int sock_fd;
2798         if (pc->cb_info == NULL) {
2799                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2800                 return CAMERA_ERROR_INVALID_PARAMETER;
2801         }
2802         sock_fd = pc->cb_info->fd;
2803         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
2804         int get_value;
2805
2806         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2807         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2808
2809         if (ret == CAMERA_ERROR_NONE) {
2810                 muse_camera_msg_get(get_value, pc->cb_info->recvMsg);
2811                 *value = get_value;
2812         }
2813         LOGD("ret : 0x%x", ret);
2814         return ret;
2815 }
2816
2817
2818 int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
2819 {
2820         if( camera == NULL || min == NULL || max == NULL ){
2821                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2822                 return CAMERA_ERROR_INVALID_PARAMETER;
2823         }
2824         int ret = CAMERA_ERROR_NONE;
2825         camera_cli_s *pc = (camera_cli_s *)camera;
2826         int sock_fd;
2827         if (pc->cb_info == NULL) {
2828                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2829                 return CAMERA_ERROR_INVALID_PARAMETER;
2830         }
2831         sock_fd = pc->cb_info->fd;
2832         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
2833         int get_min;
2834         int get_max;
2835
2836         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2837         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2838
2839         if (ret == CAMERA_ERROR_NONE) {
2840                 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2841                 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2842                 *min = get_min;
2843                 *max = get_max;
2844         }
2845         LOGD("ret : 0x%x", ret);
2846         return ret;
2847 }
2848
2849
2850 int camera_attr_get_iso( camera_h camera,  camera_attr_iso_e *iso)
2851 {
2852         if( camera == NULL || iso == NULL){
2853                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2854                 return CAMERA_ERROR_INVALID_PARAMETER;
2855         }
2856         int ret = CAMERA_ERROR_NONE;
2857         camera_cli_s *pc = (camera_cli_s *)camera;
2858         int sock_fd;
2859         if (pc->cb_info == NULL) {
2860                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2861                 return CAMERA_ERROR_INVALID_PARAMETER;
2862         }
2863         sock_fd = pc->cb_info->fd;
2864         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
2865         int get_iso;
2866
2867         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2868         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2869
2870         if (ret == CAMERA_ERROR_NONE) {
2871                 muse_camera_msg_get(get_iso, pc->cb_info->recvMsg);
2872                 *iso = (camera_attr_iso_e)get_iso;
2873         }
2874         LOGD("ret : 0x%x", ret);
2875         return ret;
2876 }
2877
2878
2879 int camera_attr_get_brightness(camera_h camera,  int *level)
2880 {
2881         if( camera == NULL || level == NULL){
2882                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2883                 return CAMERA_ERROR_INVALID_PARAMETER;
2884         }
2885         int ret = CAMERA_ERROR_NONE;
2886         camera_cli_s *pc = (camera_cli_s *)camera;
2887         int sock_fd;
2888         if (pc->cb_info == NULL) {
2889                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2890                 return CAMERA_ERROR_INVALID_PARAMETER;
2891         }
2892         sock_fd = pc->cb_info->fd;
2893         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
2894         int get_level;
2895
2896         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2897         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2898
2899         if (ret == CAMERA_ERROR_NONE) {
2900                 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
2901                 *level = get_level;
2902         }
2903         LOGD("ret : 0x%x", ret);
2904         return ret;
2905 }
2906
2907
2908 int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
2909 {
2910         if( camera == NULL || min == NULL || max == NULL ){
2911                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2912                 return CAMERA_ERROR_INVALID_PARAMETER;
2913         }
2914         int ret = CAMERA_ERROR_NONE;
2915         camera_cli_s *pc = (camera_cli_s *)camera;
2916         int sock_fd;
2917         if (pc->cb_info == NULL) {
2918                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2919                 return CAMERA_ERROR_INVALID_PARAMETER;
2920         }
2921         sock_fd = pc->cb_info->fd;
2922         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
2923         int get_min;
2924         int get_max;
2925
2926         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2927         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2928
2929         if (ret == CAMERA_ERROR_NONE) {
2930                 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2931                 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2932                 *min = get_min;
2933                 *max = get_max;
2934         }
2935         LOGD("ret : 0x%x", ret);
2936         return ret;
2937 }
2938
2939
2940 int camera_attr_get_contrast(camera_h camera,  int *level)
2941 {
2942         if( camera == NULL || level == NULL){
2943                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2944                 return CAMERA_ERROR_INVALID_PARAMETER;
2945         }
2946         int ret = CAMERA_ERROR_NONE;
2947         camera_cli_s *pc = (camera_cli_s *)camera;
2948         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
2949         int sock_fd;
2950         if (pc->cb_info == NULL) {
2951                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2952                 return CAMERA_ERROR_INVALID_PARAMETER;
2953         }
2954         sock_fd = pc->cb_info->fd;
2955         int get_level;
2956
2957         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2958         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2959
2960         if (ret == CAMERA_ERROR_NONE) {
2961                 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
2962                 *level = get_level;
2963         }
2964         LOGD("ret : 0x%x", ret);
2965         return ret;
2966 }
2967
2968
2969 int camera_attr_get_contrast_range(camera_h camera, int *min , int *max)
2970 {
2971         if( camera == NULL || min == NULL || max == NULL ){
2972                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2973                 return CAMERA_ERROR_INVALID_PARAMETER;
2974         }
2975         int ret = CAMERA_ERROR_NONE;
2976         camera_cli_s *pc = (camera_cli_s *)camera;
2977         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
2978         int sock_fd;
2979         if (pc->cb_info == NULL) {
2980                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2981                 return CAMERA_ERROR_INVALID_PARAMETER;
2982         }
2983         sock_fd = pc->cb_info->fd;
2984         int get_min;
2985         int get_max;
2986
2987         LOGD("Enter, remote_handle : %x", pc->remote_handle);
2988         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2989
2990         if (ret == CAMERA_ERROR_NONE) {
2991                 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2992                 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2993                 *min = get_min;
2994                 *max = get_max;
2995         }
2996         LOGD("ret : 0x%x", ret);
2997         return ret;
2998 }
2999
3000
3001 int camera_attr_get_whitebalance(camera_h camera,  camera_attr_whitebalance_e *wb)
3002 {
3003         if( camera == NULL || wb == NULL){
3004                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3005                 return CAMERA_ERROR_INVALID_PARAMETER;
3006         }
3007         int ret = CAMERA_ERROR_NONE;
3008         camera_cli_s *pc = (camera_cli_s *)camera;
3009         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
3010         int sock_fd;
3011         if (pc->cb_info == NULL) {
3012                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3013                 return CAMERA_ERROR_INVALID_PARAMETER;
3014         }
3015         sock_fd = pc->cb_info->fd;
3016         int get_wb;
3017
3018         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3019         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3020
3021         if (ret == CAMERA_ERROR_NONE) {
3022                 muse_camera_msg_get(get_wb, pc->cb_info->recvMsg);
3023                 *wb = (camera_attr_whitebalance_e)get_wb;
3024         }
3025         LOGD("ret : 0x%x", ret);
3026         return ret;
3027 }
3028
3029
3030 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
3031 {
3032         if( camera == NULL || effect == NULL ){
3033                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3034                 return CAMERA_ERROR_INVALID_PARAMETER;
3035         }
3036
3037         int ret = CAMERA_ERROR_NONE;
3038         camera_cli_s *pc = (camera_cli_s *)camera;
3039         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
3040         int sock_fd;
3041         if (pc->cb_info == NULL) {
3042                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3043                 return CAMERA_ERROR_INVALID_PARAMETER;
3044         }
3045         sock_fd = pc->cb_info->fd;
3046         int get_effect;
3047
3048         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3049         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3050
3051         if (ret == CAMERA_ERROR_NONE) {
3052                 muse_camera_msg_get(get_effect, pc->cb_info->recvMsg);
3053                 *effect = (camera_attr_effect_mode_e)get_effect;
3054         }
3055         LOGD("ret : 0x%x", ret);
3056         return ret;
3057 }
3058
3059
3060 int camera_attr_get_scene_mode(camera_h camera,  camera_attr_scene_mode_e *mode)
3061 {
3062         if( camera == NULL || mode == NULL){
3063                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3064                 return CAMERA_ERROR_INVALID_PARAMETER;
3065         }
3066
3067         int ret = CAMERA_ERROR_NONE;
3068         camera_cli_s *pc = (camera_cli_s *)camera;
3069         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
3070         int sock_fd;
3071         if (pc->cb_info == NULL) {
3072                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3073                 return CAMERA_ERROR_INVALID_PARAMETER;
3074         }
3075         sock_fd = pc->cb_info->fd;
3076         int get_mode;
3077
3078         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3079         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3080
3081         if (ret == CAMERA_ERROR_NONE) {
3082                 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3083                 *mode = (camera_attr_scene_mode_e)get_mode;
3084         }
3085         LOGD("ret : 0x%x", ret);
3086         return ret;
3087 }
3088
3089
3090 int camera_attr_is_enabled_tag(camera_h camera,  bool *enable)
3091 {
3092         if( camera == NULL || enable == NULL){
3093                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3094                 return CAMERA_ERROR_INVALID_PARAMETER;
3095         }
3096
3097         int ret = CAMERA_ERROR_NONE;
3098         camera_cli_s *pc = (camera_cli_s *)camera;
3099         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
3100         int sock_fd;
3101         if (pc->cb_info == NULL) {
3102                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3103                 return CAMERA_ERROR_INVALID_PARAMETER;
3104         }
3105         sock_fd = pc->cb_info->fd;
3106         int get_enable;
3107
3108         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3109         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3110
3111         if (ret == CAMERA_ERROR_NONE) {
3112                 muse_camera_msg_get(get_enable, pc->cb_info->recvMsg);
3113                 *enable = (bool)get_enable;
3114         }
3115         LOGD("ret : 0x%x", ret);
3116         return ret;
3117 }
3118
3119
3120 int camera_attr_get_tag_image_description(camera_h camera,  char **description)
3121 {
3122         if( camera == NULL || description == NULL){
3123                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3124                 return CAMERA_ERROR_INVALID_PARAMETER;
3125         }
3126
3127         int ret = CAMERA_ERROR_NONE;
3128         camera_cli_s *pc = (camera_cli_s *)camera;
3129         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
3130         int sock_fd;
3131         if (pc->cb_info == NULL) {
3132                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3133                 return CAMERA_ERROR_INVALID_PARAMETER;
3134         }
3135         sock_fd = pc->cb_info->fd;
3136         char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3137
3138         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3139         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3140
3141         if (ret == CAMERA_ERROR_NONE) {
3142                 muse_camera_msg_get_string(get_description, pc->cb_info->recvMsg);
3143                 *description = strdup(get_description);
3144         }
3145         LOGD("ret : 0x%x", ret);
3146         return ret;
3147 }
3148
3149
3150 int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
3151 {
3152         if( camera == NULL || orientation == NULL){
3153                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3154                 return CAMERA_ERROR_INVALID_PARAMETER;
3155         }
3156
3157         int ret = CAMERA_ERROR_NONE;
3158         camera_cli_s *pc = (camera_cli_s *)camera;
3159         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
3160         int sock_fd;
3161         if (pc->cb_info == NULL) {
3162                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3163                 return CAMERA_ERROR_INVALID_PARAMETER;
3164         }
3165         sock_fd = pc->cb_info->fd;
3166         int get_orientation;
3167
3168         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3169         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3170
3171         if (ret == CAMERA_ERROR_NONE) {
3172                 muse_camera_msg_get(get_orientation, pc->cb_info->recvMsg);
3173                 *orientation = (camera_attr_tag_orientation_e)get_orientation;
3174                 LOGD("success, orientation : %d", *orientation);
3175         }
3176         LOGD("ret : 0x%x", ret);
3177         return ret;
3178 }
3179
3180
3181 int camera_attr_get_tag_software(camera_h camera, char **software)
3182 {
3183         if( camera == NULL || software == NULL ){
3184                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3185                 return CAMERA_ERROR_INVALID_PARAMETER;
3186         }
3187
3188         int ret = CAMERA_ERROR_NONE;
3189         camera_cli_s *pc = (camera_cli_s *)camera;
3190         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
3191         int sock_fd;
3192         if (pc->cb_info == NULL) {
3193                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3194                 return CAMERA_ERROR_INVALID_PARAMETER;
3195         }
3196         sock_fd = pc->cb_info->fd;
3197         char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3198
3199         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3200         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3201
3202         if (ret == CAMERA_ERROR_NONE) {
3203                 muse_camera_msg_get_string(get_software, pc->cb_info->recvMsg);
3204                 *software = strdup(get_software);
3205         }
3206         LOGD("ret : 0x%x", ret);
3207         return ret;
3208 }
3209
3210
3211 int camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
3212 {
3213         if( camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL){
3214                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3215                 return CAMERA_ERROR_INVALID_PARAMETER;
3216         }
3217
3218         int ret = CAMERA_ERROR_NONE;
3219         camera_cli_s *pc = (camera_cli_s *)camera;
3220         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
3221         double get_geotag[3] = {0,};
3222         int sock_fd;
3223         if (pc->cb_info == NULL) {
3224                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3225                 return CAMERA_ERROR_INVALID_PARAMETER;
3226         }
3227         sock_fd = pc->cb_info->fd;
3228         int valid = 0;
3229         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3230         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3231
3232         if (ret == CAMERA_ERROR_NONE) {
3233                 muse_camera_msg_get_array(get_geotag, pc->cb_info->recvMsg);
3234                 *latitude = get_geotag[0];
3235                 *longitude = get_geotag[1];
3236                 *altitude = get_geotag[2];
3237         } else {
3238                 LOGE("Returned value is not valid : 0x%x", valid);
3239                 *latitude = 0;
3240                 *longitude = 0;
3241                 *altitude = 0;
3242         }
3243         LOGD("ret : 0x%x", ret);
3244         return ret;
3245 }
3246
3247
3248 int camera_attr_get_flash_mode(camera_h camera,  camera_attr_flash_mode_e *mode)
3249 {
3250         if( camera == NULL || mode == NULL){
3251                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3252                 return CAMERA_ERROR_INVALID_PARAMETER;
3253         }
3254
3255         int ret = CAMERA_ERROR_NONE;
3256         camera_cli_s *pc = (camera_cli_s *)camera;
3257         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
3258         int sock_fd;
3259         if (pc->cb_info == NULL) {
3260                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3261                 return CAMERA_ERROR_INVALID_PARAMETER;
3262         }
3263         sock_fd = pc->cb_info->fd;
3264         int get_mode;
3265
3266         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3267         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3268
3269         if (ret == CAMERA_ERROR_NONE) {
3270                 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3271                 *mode = (camera_attr_flash_mode_e)get_mode;
3272         }
3273         LOGD("ret : 0x%x", ret);
3274         return ret;
3275 }
3276
3277
3278 int camera_attr_foreach_supported_af_mode( camera_h camera, camera_attr_supported_af_mode_cb foreach_cb , void *user_data)
3279 {
3280         if( camera == NULL || foreach_cb == NULL){
3281                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3282                 return CAMERA_ERROR_INVALID_PARAMETER;
3283         }
3284         int ret = CAMERA_ERROR_NONE;
3285
3286         camera_cli_s *pc = (camera_cli_s *)camera;
3287         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
3288
3289         LOGD("Enter, handle :%x", pc->remote_handle);
3290
3291         int sock_fd;
3292         if (pc->cb_info == NULL) {
3293                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3294                 return CAMERA_ERROR_INVALID_PARAMETER;
3295         }
3296         sock_fd = pc->cb_info->fd;
3297         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
3298         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
3299
3300         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3301         LOGD("ret : 0x%x", ret);
3302         return ret;
3303 }
3304
3305
3306 int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb , void *user_data)
3307 {
3308         if( camera == NULL || foreach_cb == NULL){
3309                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3310                 return CAMERA_ERROR_INVALID_PARAMETER;
3311         }
3312         int ret = CAMERA_ERROR_NONE;
3313
3314         camera_cli_s *pc = (camera_cli_s *)camera;
3315         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
3316
3317         LOGD("Enter, handle :%x", pc->remote_handle);
3318
3319         int sock_fd;
3320         if (pc->cb_info == NULL) {
3321                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3322                 return CAMERA_ERROR_INVALID_PARAMETER;
3323         }
3324         sock_fd = pc->cb_info->fd;
3325         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
3326         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
3327
3328         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3329         LOGD("ret : 0x%x", ret);
3330         return ret;
3331 }
3332
3333
3334 int camera_attr_foreach_supported_iso( camera_h camera, camera_attr_supported_iso_cb foreach_cb , void *user_data)
3335 {
3336         if( camera == NULL || foreach_cb == NULL){
3337                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3338                 return CAMERA_ERROR_INVALID_PARAMETER;
3339         }
3340         int ret = CAMERA_ERROR_NONE;
3341
3342         camera_cli_s *pc = (camera_cli_s *)camera;
3343         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
3344
3345         LOGD("Enter, handle :%x", pc->remote_handle);
3346
3347         int sock_fd;
3348         if (pc->cb_info == NULL) {
3349                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3350                 return CAMERA_ERROR_INVALID_PARAMETER;
3351         }
3352         sock_fd = pc->cb_info->fd;
3353         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
3354         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
3355
3356         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3357         LOGD("ret : 0x%x", ret);
3358         return ret;
3359 }
3360
3361
3362 int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb , void *user_data)
3363 {
3364         if( camera == NULL || foreach_cb == NULL){
3365                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3366                 return CAMERA_ERROR_INVALID_PARAMETER;
3367         }
3368         int ret = CAMERA_ERROR_NONE;
3369
3370         camera_cli_s *pc = (camera_cli_s *)camera;
3371         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
3372
3373         LOGD("Enter, handle :%x", pc->remote_handle);
3374
3375         int sock_fd;
3376         if (pc->cb_info == NULL) {
3377                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3378                 return CAMERA_ERROR_INVALID_PARAMETER;
3379         }
3380         sock_fd = pc->cb_info->fd;
3381         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
3382         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
3383
3384         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3385         LOGD("ret : 0x%x", ret);
3386         return ret;
3387 }
3388
3389
3390 int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb , void *user_data)
3391 {
3392         if( camera == NULL || foreach_cb == NULL){
3393                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3394                 return CAMERA_ERROR_INVALID_PARAMETER;
3395         }
3396         int ret = CAMERA_ERROR_NONE;
3397
3398         camera_cli_s *pc = (camera_cli_s *)camera;
3399         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
3400
3401         LOGD("Enter, handle :%x", pc->remote_handle);
3402
3403         int sock_fd;
3404         if (pc->cb_info == NULL) {
3405                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3406                 return CAMERA_ERROR_INVALID_PARAMETER;
3407         }
3408         sock_fd = pc->cb_info->fd;
3409         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
3410         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
3411
3412         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3413         LOGD("ret : 0x%x", ret);
3414         return ret;
3415 }
3416
3417
3418 int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb , void *user_data)
3419 {
3420         if( camera == NULL || foreach_cb == NULL){
3421                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3422                 return CAMERA_ERROR_INVALID_PARAMETER;
3423         }
3424         int ret = CAMERA_ERROR_NONE;
3425
3426         camera_cli_s *pc = (camera_cli_s *)camera;
3427         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
3428
3429         LOGD("Enter, handle :%x", pc->remote_handle);
3430
3431         int sock_fd;
3432         if (pc->cb_info == NULL) {
3433                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3434                 return CAMERA_ERROR_INVALID_PARAMETER;
3435         }
3436         sock_fd = pc->cb_info->fd;
3437         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
3438         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
3439
3440         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3441         LOGD("ret : 0x%x", ret);
3442         return ret;
3443 }
3444
3445
3446 int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb , void *user_data)
3447 {
3448         if( camera == NULL || foreach_cb == NULL){
3449                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3450                 return CAMERA_ERROR_INVALID_PARAMETER;
3451         }
3452         int ret = CAMERA_ERROR_NONE;
3453
3454         camera_cli_s *pc = (camera_cli_s *)camera;
3455         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
3456
3457         LOGD("Enter, handle :%x", pc->remote_handle);
3458
3459         int sock_fd;
3460         if (pc->cb_info == NULL) {
3461                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3462                 return CAMERA_ERROR_INVALID_PARAMETER;
3463         }
3464         sock_fd = pc->cb_info->fd;
3465         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
3466         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = user_data;
3467
3468         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3469         LOGD("ret : 0x%x", ret);
3470         return ret;
3471 }
3472
3473
3474 int camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb foreach_cb , void *user_data)
3475 {
3476         if( camera == NULL || foreach_cb == NULL){
3477                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3478                 return CAMERA_ERROR_INVALID_PARAMETER;
3479         }
3480         int ret = CAMERA_ERROR_NONE;
3481
3482         camera_cli_s *pc = (camera_cli_s *)camera;
3483         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS;
3484         int sock_fd;
3485         if (pc->cb_info == NULL) {
3486                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3487                 return CAMERA_ERROR_INVALID_PARAMETER;
3488         }
3489         sock_fd = pc->cb_info->fd;
3490         LOGD("Enter, handle :%x", pc->remote_handle);
3491         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = foreach_cb;
3492         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
3493
3494         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3495         LOGD("Enter, handle :%x", pc->remote_handle);
3496         return ret;
3497 }
3498
3499 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)
3500 {
3501         if( camera == NULL || foreach_cb == NULL){
3502                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3503                 return CAMERA_ERROR_INVALID_PARAMETER;
3504         }
3505         int ret = CAMERA_ERROR_NONE;
3506
3507         camera_cli_s *pc = (camera_cli_s *)camera;
3508         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
3509         int sock_fd;
3510         if (pc->cb_info == NULL) {
3511                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3512                 return CAMERA_ERROR_INVALID_PARAMETER;
3513         }
3514         sock_fd = pc->cb_info->fd;
3515         LOGD("Enter, handle :%x", pc->remote_handle);
3516         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = foreach_cb;
3517         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = user_data;
3518
3519         muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
3520         LOGD("ret : 0x%x", ret);
3521         return ret;
3522 }
3523
3524 int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
3525 {
3526         if( camera == NULL || foreach_cb == NULL){
3527                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3528                 return CAMERA_ERROR_INVALID_PARAMETER;
3529         }
3530         int ret = CAMERA_ERROR_NONE;
3531
3532         camera_cli_s *pc = (camera_cli_s *)camera;
3533         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
3534         int sock_fd;
3535         if (pc->cb_info == NULL) {
3536                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3537                 return CAMERA_ERROR_INVALID_PARAMETER;
3538         }
3539         sock_fd = pc->cb_info->fd;
3540         LOGD("Enter, handle :%x", pc->remote_handle);
3541         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
3542         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
3543
3544         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3545         LOGD("ret : 0x%x", ret);
3546         return ret;
3547 }
3548
3549
3550 int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
3551 {
3552         if( camera == NULL || foreach_cb == NULL){
3553                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3554                 return CAMERA_ERROR_INVALID_PARAMETER;
3555         }
3556         int ret = CAMERA_ERROR_NONE;
3557
3558         camera_cli_s *pc = (camera_cli_s *)camera;
3559         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION;
3560         int sock_fd;
3561         if (pc->cb_info == NULL) {
3562                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3563                 return CAMERA_ERROR_INVALID_PARAMETER;
3564         }
3565         sock_fd = pc->cb_info->fd;
3566         LOGD("Enter, handle :%x", pc->remote_handle);
3567         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
3568         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
3569
3570         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3571         LOGD("ret : 0x%x", ret);
3572         return ret;
3573 }
3574
3575
3576 int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation)
3577 {
3578         if( camera == NULL){
3579                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3580                 return CAMERA_ERROR_INVALID_PARAMETER;
3581         }
3582
3583         int ret = CAMERA_ERROR_NONE;
3584         camera_cli_s *pc = (camera_cli_s *)camera;
3585         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
3586         int sock_fd;
3587         if (pc->cb_info == NULL) {
3588                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3589                 return CAMERA_ERROR_INVALID_PARAMETER;
3590         }
3591         sock_fd = pc->cb_info->fd;
3592         int set_rotation = (int)rotation;
3593
3594         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3595         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
3596         LOGD("ret : 0x%x", ret);
3597         return ret;
3598 }
3599
3600
3601 int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation)
3602 {
3603         if( camera == NULL || rotation == NULL ){
3604                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3605                 return CAMERA_ERROR_INVALID_PARAMETER;
3606         }
3607
3608         int ret = CAMERA_ERROR_NONE;
3609         camera_cli_s *pc = (camera_cli_s *)camera;
3610         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
3611         int sock_fd;
3612         if (pc->cb_info == NULL) {
3613                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3614                 return CAMERA_ERROR_INVALID_PARAMETER;
3615         }
3616         sock_fd = pc->cb_info->fd;
3617         int get_rotation;
3618
3619         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3620         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3621
3622         if (ret == CAMERA_ERROR_NONE) {
3623                 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
3624                 *rotation = (camera_rotation_e)get_rotation;
3625         }
3626         LOGD("ret : 0x%x", ret);
3627         return ret;
3628 }
3629
3630
3631 int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip)
3632 {
3633         if( camera == NULL){
3634                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3635                 return CAMERA_ERROR_INVALID_PARAMETER;
3636         }
3637
3638         int ret = CAMERA_ERROR_NONE;
3639         camera_cli_s *pc = (camera_cli_s *)camera;
3640         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
3641         int sock_fd;
3642         if (pc->cb_info == NULL) {
3643                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3644                 return CAMERA_ERROR_INVALID_PARAMETER;
3645         }
3646         sock_fd = pc->cb_info->fd;
3647         int set_flip = (int)flip;
3648
3649         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3650         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
3651         LOGD("ret : 0x%x", ret);
3652         return ret;
3653 }
3654
3655
3656 int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip)
3657 {
3658         if( camera == NULL || flip == NULL ){
3659                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3660                 return CAMERA_ERROR_INVALID_PARAMETER;
3661         }
3662
3663         int ret = CAMERA_ERROR_NONE;
3664         camera_cli_s *pc = (camera_cli_s *)camera;
3665         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
3666         int sock_fd;
3667         if (pc->cb_info == NULL) {
3668                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3669                 return CAMERA_ERROR_INVALID_PARAMETER;
3670         }
3671         sock_fd = pc->cb_info->fd;
3672         int get_flip;
3673
3674         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3675         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3676
3677         if (ret == CAMERA_ERROR_NONE) {
3678                 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
3679                 *flip = (camera_flip_e)get_flip;
3680         }
3681         LOGD("ret : 0x%x", ret);
3682         return ret;
3683 }
3684
3685 int camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
3686 {
3687         if( camera == NULL){
3688                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3689                 return CAMERA_ERROR_INVALID_PARAMETER;
3690         }
3691
3692         int ret = CAMERA_ERROR_NONE;
3693         camera_cli_s *pc = (camera_cli_s *)camera;
3694         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
3695         int sock_fd;
3696         if (pc->cb_info == NULL) {
3697                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3698                 return CAMERA_ERROR_INVALID_PARAMETER;
3699         }
3700         sock_fd = pc->cb_info->fd;
3701         int set_mode = (int)mode;
3702
3703         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3704         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3705         LOGD("ret : 0x%x", ret);
3706         return ret;
3707 }
3708
3709
3710 int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
3711 {
3712         if (camera == NULL) {
3713                 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
3714                 return CAMERA_ERROR_INVALID_PARAMETER;
3715         }
3716         if (mode == NULL) {
3717                 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - mode",CAMERA_ERROR_NOT_SUPPORTED);
3718                 return CAMERA_ERROR_NOT_SUPPORTED;
3719         }
3720         int ret = CAMERA_ERROR_NONE;
3721         camera_cli_s *pc = (camera_cli_s *)camera;
3722         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
3723         int sock_fd;
3724         if (pc->cb_info == NULL) {
3725                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3726                 return CAMERA_ERROR_INVALID_PARAMETER;
3727         }
3728         sock_fd = pc->cb_info->fd;
3729         int get_mode;
3730
3731         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3732         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3733
3734         if (ret == CAMERA_ERROR_NONE) {
3735                 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3736                 *mode = (camera_attr_hdr_mode_e)get_mode;
3737         }
3738         LOGD("ret : 0x%x", ret);
3739         return ret;
3740 }
3741
3742
3743 bool camera_attr_is_supported_hdr_capture(camera_h camera)
3744 {
3745         if( camera == NULL){
3746                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3747                 return false;
3748         }
3749
3750         int ret = CAMERA_ERROR_NONE;
3751         camera_cli_s *pc = (camera_cli_s *)camera;
3752         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
3753         int sock_fd;
3754         if (pc->cb_info == NULL) {
3755                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3756                 return CAMERA_ERROR_INVALID_PARAMETER;
3757         }
3758         sock_fd = pc->cb_info->fd;
3759         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3760         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3761         LOGD("ret : 0x%x", ret);
3762         return (bool)ret;
3763 }
3764
3765
3766 int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data)
3767 {
3768         if (camera == NULL) {
3769                 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3770                 return CAMERA_ERROR_INVALID_PARAMETER;
3771         }
3772         if (callback == NULL) {
3773                 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - callback", CAMERA_ERROR_NOT_SUPPORTED);
3774                 return CAMERA_ERROR_NOT_SUPPORTED;
3775         }
3776         int ret = CAMERA_ERROR_NONE;
3777
3778         camera_cli_s *pc = (camera_cli_s *)camera;
3779         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
3780         int sock_fd;
3781         if (pc->cb_info == NULL) {
3782                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3783                 return CAMERA_ERROR_INVALID_PARAMETER;
3784         }
3785         sock_fd = pc->cb_info->fd;
3786         LOGD("Enter, handle :%x", pc->remote_handle);
3787
3788         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = callback;
3789         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = user_data;
3790
3791         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3792         LOGD("ret : 0x%x", ret);
3793         return ret;
3794 }
3795
3796
3797 int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
3798 {
3799         if( camera == NULL){
3800                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3801                 return CAMERA_ERROR_INVALID_PARAMETER;
3802         }
3803
3804         int ret = CAMERA_ERROR_NONE;
3805
3806         camera_cli_s *pc = (camera_cli_s *)camera;
3807         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
3808         int sock_fd;
3809         if (pc->cb_info == NULL) {
3810                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3811                 return CAMERA_ERROR_INVALID_PARAMETER;
3812         }
3813         sock_fd = pc->cb_info->fd;
3814         LOGD("Enter, handle :%x", pc->remote_handle);
3815
3816         pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3817         pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3818
3819         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3820         LOGD("ret : 0x%x", ret);
3821         return ret;
3822 }
3823
3824
3825 int camera_attr_enable_anti_shake(camera_h camera, bool enable)
3826 {
3827         if (camera == NULL) {
3828                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3829                 return CAMERA_ERROR_INVALID_PARAMETER;
3830         }
3831
3832         int ret = CAMERA_ERROR_NONE;
3833         camera_cli_s *pc = (camera_cli_s *)camera;
3834         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
3835         int sock_fd;
3836         if (pc->cb_info == NULL) {
3837                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3838                 return CAMERA_ERROR_INVALID_PARAMETER;
3839         }
3840         sock_fd = pc->cb_info->fd;
3841         int set_enable = (int)enable;
3842
3843         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3844         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3845         LOGD("ret : 0x%x", ret);
3846         return ret;
3847 }
3848
3849
3850 int camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled)
3851 {
3852         if (camera == NULL) {
3853                 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3854                 return CAMERA_ERROR_INVALID_PARAMETER;
3855         }
3856         if (enabled == NULL) {
3857                 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
3858                 return CAMERA_ERROR_NOT_SUPPORTED;
3859         }
3860         int ret = CAMERA_ERROR_NONE;
3861         camera_cli_s *pc = (camera_cli_s *)camera;
3862         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
3863         int sock_fd;
3864         if (pc->cb_info == NULL) {
3865                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3866                 return CAMERA_ERROR_INVALID_PARAMETER;
3867         }
3868         sock_fd = pc->cb_info->fd;
3869         int get_enabled;
3870
3871         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3872         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3873
3874         if (ret == CAMERA_ERROR_NONE) {
3875                 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
3876                 *enabled = (bool)get_enabled;
3877         }
3878         LOGD("ret : 0x%x", ret);
3879         return ret;
3880 }
3881
3882
3883 bool camera_attr_is_supported_anti_shake(camera_h camera)
3884 {
3885
3886         if( camera == NULL){
3887                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3888                 return false;
3889         }
3890
3891         int ret = CAMERA_ERROR_NONE;
3892         camera_cli_s *pc = (camera_cli_s *)camera;
3893         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
3894         int sock_fd;
3895         if (pc->cb_info == NULL) {
3896                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3897                 return CAMERA_ERROR_INVALID_PARAMETER;
3898         }
3899         sock_fd = pc->cb_info->fd;
3900         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3901         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3902         LOGD("ret : 0x%x", ret);
3903         return ret;
3904 }
3905
3906
3907 int camera_attr_enable_video_stabilization(camera_h camera, bool enable)
3908 {
3909         if (camera == NULL) {
3910                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3911                 return CAMERA_ERROR_INVALID_PARAMETER;
3912         }
3913
3914         int ret = CAMERA_ERROR_NONE;
3915         camera_cli_s *pc = (camera_cli_s *)camera;
3916         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
3917         int sock_fd;
3918         if (pc->cb_info == NULL) {
3919                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3920                 return CAMERA_ERROR_INVALID_PARAMETER;
3921         }
3922         sock_fd = pc->cb_info->fd;
3923         int set_enable = (int)enable;
3924
3925         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3926         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3927         LOGD("ret : 0x%x", ret);
3928         return ret;
3929 }
3930
3931
3932 int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
3933 {
3934         if (camera == NULL) {
3935                 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
3936                 return CAMERA_ERROR_INVALID_PARAMETER;
3937         }
3938         if (enabled == NULL) {
3939                 LOGE("INVALID_PARAMETER(0x%08x) - enabled",CAMERA_ERROR_INVALID_PARAMETER);
3940                 return CAMERA_ERROR_NOT_SUPPORTED;
3941         }
3942         int ret = CAMERA_ERROR_NONE;
3943         camera_cli_s *pc = (camera_cli_s *)camera;
3944         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
3945         int sock_fd;
3946         if (pc->cb_info == NULL) {
3947                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3948                 return CAMERA_ERROR_INVALID_PARAMETER;
3949         }
3950         sock_fd = pc->cb_info->fd;
3951         int get_enabled;
3952
3953         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3954         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3955
3956         if (ret == CAMERA_ERROR_NONE) {
3957                 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
3958                 *enabled = (bool)get_enabled;
3959         }
3960         LOGD("ret : 0x%x", ret);
3961         return ret;
3962 }
3963
3964
3965 bool camera_attr_is_supported_video_stabilization(camera_h camera)
3966 {
3967         if( camera == NULL){
3968                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3969                 return false;
3970         }
3971
3972         int ret = CAMERA_ERROR_NONE;
3973         camera_cli_s *pc = (camera_cli_s *)camera;
3974         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
3975         int sock_fd;
3976         if (pc->cb_info == NULL) {
3977                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3978                 return CAMERA_ERROR_INVALID_PARAMETER;
3979         }
3980         sock_fd = pc->cb_info->fd;
3981         LOGD("Enter, remote_handle : %x", pc->remote_handle);
3982         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3983         LOGD("ret : 0x%x", ret);
3984         return ret;
3985 }
3986
3987
3988 int camera_attr_enable_auto_contrast(camera_h camera, bool enable)
3989 {
3990         if( camera == NULL){
3991                 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3992                 return CAMERA_ERROR_INVALID_PARAMETER;
3993         }
3994
3995         int ret = CAMERA_ERROR_NONE;
3996         camera_cli_s *pc = (camera_cli_s *)camera;
3997         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
3998         int sock_fd;
3999         if (pc->cb_info == NULL) {
4000                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4001                 return CAMERA_ERROR_INVALID_PARAMETER;
4002         }
4003         sock_fd = pc->cb_info->fd;
4004         int set_enable = (int)enable;
4005
4006         LOGD("Enter, remote_handle : %x", pc->remote_handle);
4007         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4008         LOGD("ret : 0x%x", ret);
4009         return ret;
4010 }
4011
4012
4013 int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
4014 {
4015         if (camera == NULL) {
4016                 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4017                 return CAMERA_ERROR_INVALID_PARAMETER;
4018         }
4019         if (enabled == NULL) {
4020                 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4021                 return CAMERA_ERROR_INVALID_PARAMETER;
4022         }
4023         int ret = CAMERA_ERROR_NONE;
4024         camera_cli_s *pc = (camera_cli_s *)camera;
4025         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
4026         int sock_fd;
4027         if (pc->cb_info == NULL) {
4028                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4029                 return CAMERA_ERROR_INVALID_PARAMETER;
4030         }
4031         sock_fd = pc->cb_info->fd;
4032         int get_enabled;
4033
4034         LOGD("Enter, remote_handle : %x", pc->remote_handle);
4035         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4036
4037         if (ret == CAMERA_ERROR_NONE) {
4038                 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4039                 *enabled = (bool)get_enabled;
4040         }
4041         LOGD("ret : 0x%x", ret);
4042         return ret;
4043 }
4044
4045
4046 bool camera_attr_is_supported_auto_contrast(camera_h camera)
4047 {
4048         if( camera == NULL){
4049                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4050                 return false;
4051         }
4052
4053         int ret = CAMERA_ERROR_NONE;
4054         camera_cli_s *pc = (camera_cli_s *)camera;
4055         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
4056         int sock_fd;
4057         if (pc->cb_info == NULL) {
4058                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4059                 return CAMERA_ERROR_INVALID_PARAMETER;
4060         }
4061         sock_fd = pc->cb_info->fd;
4062         LOGD("Enter, remote_handle : %x", pc->remote_handle);
4063         muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4064         LOGD("ret : 0x%x", ret);
4065         return ret;
4066 }
4067
4068
4069 int camera_attr_disable_shutter_sound(camera_h camera, bool disable)
4070 {
4071         if (camera == NULL) {
4072                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4073                 return CAMERA_ERROR_INVALID_PARAMETER;
4074         }
4075
4076         int ret = CAMERA_ERROR_NONE;
4077         camera_cli_s *pc = (camera_cli_s *)camera;
4078         muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
4079         int sock_fd;
4080         if (pc->cb_info == NULL) {
4081                 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4082                 return CAMERA_ERROR_INVALID_PARAMETER;
4083         }
4084         sock_fd = pc->cb_info->fd;
4085         int set_disable = (int)disable;
4086
4087         LOGD("Enter, remote_handle : %x", pc->remote_handle);
4088         muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_disable);
4089         LOGD("ret : 0x%x", ret);
4090         return ret;
4091 }