Set pid for sound focus
[platform/core/api/camera.git] / src / camera_internal.c
index 9db01a2..1a6565d 100644 (file)
@@ -20,7 +20,9 @@
 #include <string.h>
 #include <mm.h>
 #include <mm_camcorder.h>
+#ifdef HAVE_WAYLAND
 #include <mm_camcorder_mused.h>
+#endif /* HAVE_WAYLAND */
 #include <mm_types.h>
 #include <camera.h>
 #include <camera_internal.h>
@@ -164,24 +166,36 @@ int camera_get_video_caps(camera_h camera, char **caps)
        int ret;
        camera_s *handle = (camera_s *)camera;
 
+#ifdef HAVE_WAYLAND
        ret = mm_camcorder_mused_get_video_caps(handle->mm_handle, caps);
        if(ret != MM_ERROR_NONE) {
                return __convert_camera_error_code(__func__, ret);
        }
+#endif /* HAVE_WAYLAND */
 
        return CAMERA_ERROR_NONE;
 }
 
 int camera_set_shm_socket_path_for_mused(camera_h camera, char *socket_path)
 {
-       int ret;
+       int ret = MM_ERROR_NONE;
        camera_s *handle = (camera_s *)camera;
 
-       LOGE("var : %s", socket_path);
-       mm_camcorder_set_attributes(handle->mm_handle, NULL,
-                                   MMCAM_DISPLAY_SHM_SOCKET_PATH, socket_path, strlen(socket_path),
-                                   NULL);
+       if (camera == NULL) {
+               LOGE("NULL handle");
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
 
+       if (socket_path == NULL) {
+               LOGE("NULL pointer for socket_path");
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       LOGD("var : %s", socket_path);
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_SHM_SOCKET_PATH, socket_path, strlen(socket_path),
+                                         NULL);
        if (ret != MM_ERROR_NONE) {
                LOGE("error set shm socket path attribute 0x%x", ret);
                return __convert_camera_error_code(__func__, ret);