Applying light weight ipc 43/84443/1 accepted/tizen/common/20160824.154753 accepted/tizen/ivi/20160825.050422 accepted/tizen/mobile/20160825.050236 accepted/tizen/mobile/20160921.022310 accepted/tizen/tv/20160825.050328 accepted/tizen/wearable/20160825.050350 submit/tizen/20160824.052737
authorJungsup Lee <jungsup4.lee@samsung.com>
Thu, 18 Aug 2016 11:03:13 +0000 (20:03 +0900)
committerJungsup Lee <jungsup4.lee@samsung.com>
Thu, 18 Aug 2016 13:14:39 +0000 (22:14 +0900)
Replace create ready file to create event with lwipc

[Version] 5.0-86
[Profile] TV
[Issue Type] Enhancement

Signed-off-by: Jungsup Lee <jungsup4.lee@samsung.com>
Change-Id: Ia5f374df219653364a56a41f115550bf045c7872

configure.ac
packaging/pulseaudio.spec
src/Makefile.am
src/daemon/main.c

index 81cfaf1..9efce9f 100644 (file)
@@ -730,6 +730,22 @@ AC_ARG_ENABLE(prelink, AC_HELP_STRING([--enable-prelink], [enable pre-link featu
  ],[USE_PRELINK=no])
 AM_CONDITIONAL([USE_PRELINK], [test "x$USE_PRELINK" = "xyes"])
 
+#### light-weight ipc support  ####
+AC_ARG_ENABLE(lwipc, AC_HELP_STRING([--enable-lwipc], [enable light weight ipc]),
+[
+ case "${enableval}" in
+         yes) USE_LWIPC=yes ;;
+         no)  USE_LWIPC=no ;;
+         *)   AC_MSG_ERROR(bad value ${enableval} for --enable-lwipc) ;;
+ esac
+ ],[USE_LWIPC=no])
+if test "x$USE_LWIPC" = "xyes"; then
+PKG_CHECK_MODULES(LWIPC, lwipc)
+AC_SUBST(LWIPC_CFLAGS)
+AC_SUBST(LWIPC_LIBS)
+fi
+AM_CONDITIONAL([USE_LWIPC], [test "x$USE_LWIPC" = "xyes"])
+
 #### Database support ####
 
 AC_ARG_WITH([database],
index 79ba165..ce93155 100644 (file)
@@ -10,7 +10,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          5.0
-Release:          85
+Release:          86
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
 URL:              http://pulseaudio.org
@@ -45,6 +45,9 @@ BuildRequires:    pkgconfig(cynara-session)
 %if %{with pulseaudio_dlog}
 BuildRequires:    pkgconfig(dlog)
 %endif
+%if "%{?TIZEN_PRODUCT_TV}" == "1"
+BuildRequires:    pkgconfig(lwipc)
+%endif
 Requires:         udev
 Requires(post):   /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -254,6 +257,7 @@ NOCONFIGURE=yes ./bootstrap.sh
 %endif
 %if "%{?TIZEN_PRODUCT_TV}" == "1"
         --enable-prelink \
+        --enable-lwipc \
 %endif
         --with-udev-rules-dir=%{udev_dir}/rules.d \
         --with-system-user=pulse \
index 60d992f..3c9ef85 100644 (file)
@@ -190,6 +190,11 @@ pulseaudio_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@P
 # This is needed because automake doesn't properly expand the foreach below
 pulseaudio_DEPENDENCIES = libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la $(PREOPEN_LIBS)
 
+if USE_LWIPC
+pulseaudio_CFLAGS += $(LWIPC_CFLAGS) -DUSE_LWIPC
+pulseaudio_LDADD += $(LWIPC_LIBS)
+endif
+
 if HAVE_DBUS
 pulseaudio_CFLAGS += $(DBUS_CFLAGS)
 pulseaudio_SOURCES += daemon/server-lookup.c daemon/server-lookup.h
index 7ab9b9a..52a25b3 100755 (executable)
@@ -99,6 +99,9 @@
 #include <pulsecore/cpu-x86.h>
 #include <pulsecore/cpu-orc.h>
 
+#ifdef USE_LWIPC
+#include <lwipc.h>
+#endif
 #include "cmdline.h"
 #include "cpulimit.h"
 #include "daemon-conf.h"
 #ifdef __TIZEN__
 #define PA_READY "/tmp/.pa_ready"
 #ifdef TIZEN_TV
+#ifdef USE_LWIPC
+#define PULSEAUDIO_READY "pulseaudio_ready"
+#else
 #define PULSEAUDIO_READY "/tmp/.pulseaudio_ready"
 #endif
+#endif
 #endif /* __TIZEN__ */
 #ifdef HAVE_LIBWRAP
 /* Only one instance of these variables */
@@ -1199,12 +1206,18 @@ int main(int argc, char *argv[]) {
     if ((fd_pa_ready = creat(PA_READY, 0644)) != -1)
         close(fd_pa_ready);
 #ifdef TIZEN_TV
+#ifdef USE_LWIPC
+    if (LwipcEventDone(PULSEAUDIO_READY) < 0)
+        pa_log_error("cannot create PULSEAUDIO_READY(pulseaudio_ready)");
+    else
+        pa_log_warn("PULSEAUDIO_READY(%s) event was created", PULSEAUDIO_READY);
+#else
     if ((fd_pulseaudio_ready = creat(PULSEAUDIO_READY, 0644)) != -1) {
         pa_log_warn("PULSEAUDIO_READY(%s) file was created", PULSEAUDIO_READY);
         close(fd_pulseaudio_ready);
-    } else {
+    } else
         pa_log_error("cannot create PULSEAUDIO_READY(/tmp/.pulseaudio_ready)");
-    }
+#endif
 #endif
 #endif /* __TIZEN__ */
     retval = 0;