Set vconf key to check state of camera 49/233249/1
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 13 May 2020 07:53:31 +0000 (16:53 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 13 May 2020 07:53:31 +0000 (16:53 +0900)
- libfeedback uses vconf key to check camera state,
  but it was not set.

[Version] 0.3.30
[Profile] Common
[Issue Type] Update

Change-Id: I16983dcc5c34177978d103656364ce4560528736
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
muse/CMakeLists.txt
muse/src/muse_camera_dispatcher.c
packaging/mmsvc-camera.spec

index e76da7c6d84d7e057e980944397e7987f31e893e..eb7f3814ccb09954aaf4e928c1083052a0e39c18 100644 (file)
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 SET(service "muse")
 SET(submodule "camera")
 
-SET(dependents "dlog glib-2.0 muse-server mm-common libtbm gstreamer-1.0")
+SET(dependents "dlog glib-2.0 vconf muse-server mm-common libtbm gstreamer-1.0")
 SET(MUSE_MODULE "${service}-${submodule}")
 
 PROJECT(${MUSE_MODULE})
index 3107120d5b9628d584d5ecb36980fe3781c892a3..37153527fdf982f5c4ffd2a97b8272aaa712d5c1 100644 (file)
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <dlog.h>
+#include <vconf.h>
 #include "muse_camera_msg.h"
 #include "muse_camera_internal.h"
 #include <muse_server.h>
@@ -860,6 +861,7 @@ void _camera_dispatcher_state_changed_cb(camera_state_e previous, camera_state_e
        char value_key[KEY_LENGTH] = {'\0',};
        int ret = CAMERA_ERROR_NONE;
        int set_value = -1;
+       int vconf_state = VCONFKEY_CAMERA_STATE_NULL;
 
        LOGD("Enter - previous %d, current %d, by_policy %d",
             previous, current, by_policy);
@@ -882,14 +884,20 @@ void _camera_dispatcher_state_changed_cb(camera_state_e previous, camera_state_e
        }
 
        snprintf(value_key, KEY_LENGTH, "device_state_camera%d", device_type);
-       if (previous == CAMERA_STATE_CREATED && current == CAMERA_STATE_PREVIEW)
+       if (previous == CAMERA_STATE_CREATED && current == CAMERA_STATE_PREVIEW) {
                set_value = CAMERA_DEVICE_STATE_WORKING;
-       else if (previous == CAMERA_STATE_PREVIEW && current == CAMERA_STATE_CREATED)
+               vconf_state = VCONFKEY_CAMERA_STATE_PREVIEW;
+       } else if (previous == CAMERA_STATE_PREVIEW && current == CAMERA_STATE_CREATED) {
                set_value = CAMERA_DEVICE_STATE_NULL;
+               vconf_state = VCONFKEY_CAMERA_STATE_NULL;
+       }
 
        if (set_value != -1) {
-               LOGD("device[%s] state set : %d", value_key, set_value);
+               LOGD("device[%s] state set : %d, vconf state : %d",
+                       value_key, set_value, vconf_state);
+
                muse_server_module_set_value(module, value_key, set_value);
+               vconf_set_int(VCONFKEY_CAMERA_STATE, vconf_state);
        }
 
        return;
index 3d8339a78321b0e81bc2f49cee8245ac448d9700..bfdd41bd27f2ed4a13950401aeb6a4915306762b 100644 (file)
@@ -1,13 +1,14 @@
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    0.3.29
-Release:    1
+Version:    0.3.30
+Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(gstreamer-1.0)
 BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(muse-server)
 BuildRequires:  pkgconfig(mm-camcorder)
 BuildRequires:  pkgconfig(capi-base-common)