make samsung pulseaudio policy optional 39/16339/1
authorJaska Uimonen <jaska.uimonen@helsinki.fi>
Thu, 13 Feb 2014 11:46:17 +0000 (13:46 +0200)
committerJaska Uimonen <jaska.uimonen@helsinki.fi>
Thu, 13 Feb 2014 12:54:15 +0000 (14:54 +0200)
Change-Id: I20db190d6de8683eb7c68d7de60a062cdc3f1979

configure.ac
packaging/libmm-sound.spec
server/mm_sound_mgr_pulse.c

index 5f4b5d2..71968ac 100644 (file)
@@ -76,6 +76,20 @@ AC_SUBST(PULSE_LIBS)
 fi
 AM_CONDITIONAL([USE_PULSE], [test "x$USE_PULSE" = "xyes"])
 
+AC_ARG_ENABLE(policy, AC_HELP_STRING([--enable-policy], [enable use of samsung policy module in pulse]),
+[
+ case "${enableval}" in
+        yes) USE_POLICY=yes ; AC_MSG_NOTICE([using samsung policy]);;
+        no)  USE_POLICY=no ; AC_MSG_NOTICE([not using samsung policy]);;
+        *)   AC_MSG_ERROR(bad value ${enableval} for --enable-policy) ;;
+ esac
+ ],[USE_POLICY=no])
+
+AM_CONDITIONAL([USE_POLICY], [test "x$USE_POLICY" = "xyes"])
+if test "x$USE_POLICY" = "xyes"; then
+    AC_DEFINE([USE_POLICY], 1, [enable samsung policy])
+fi
+
 dnl use security --------------------------------------------------------------------------
 AC_ARG_ENABLE(security, AC_HELP_STRING([--enable-security], [using security]),
 [
index 0f3d60d..0f5e997 100644 (file)
@@ -1,4 +1,6 @@
 %bcond_with audio_session_manager_with_murphy
+%bcond_with pulseaudio_samsung_policy
+
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
 Version:    0.7.2e
@@ -72,7 +74,11 @@ CFLAGS="%{optflags} -fvisibility=hidden -DMM_DEBUG_FLAG -DSEPARATE_SPEAKER_AND_W
 %if %{with audio_session_manager_with_murphy}
 CFLAGS="$CFLAGS -DMURPHY"; export CFLAGS
 %endif
+%if %{with pulseaudio_samsung_policy}
+%configure --prefix=/usr --enable-pulse --enable-security --enable-policy
+%else
 %configure --prefix=/usr --enable-pulse --enable-security
+%endif
 make %{?_smp_mflags}
 
 %install
index cb8c19a..1d2f272 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <errno.h>
 
+#include "config.h"
 #include "include/mm_sound_mgr_common.h"
 #include "../include/mm_sound_common.h"
 
 //#include <avsys-audio.h>
 
 #include <pulse/pulseaudio.h>
+
+#ifdef USE_POLICY
 #include <pulse/ext-policy.h>
+#endif
 
 #define SUPPORT_MONO_AUDIO
 
@@ -387,7 +391,9 @@ static void mono_changed_cb(keynode_t* node, void* data)
        vconf_get_bool(MONO_KEY, &key_value);
        debug_msg ("key value = %d\n", key_value);
 
+#ifdef USE_POLICY
        pa_operation_unref (pa_ext_policy_set_mono (pinfo->context, key_value, success_cb, NULL));
+#endif
 }
 
 int MMSoundMgrPulseHandleRegisterMonoAudio (void* pinfo)