From 350b595a629740a94cf02bec4e5e1d30acccb0bb Mon Sep 17 00:00:00 2001 From: YoungHun Kim Date: Thu, 3 Nov 2016 13:18:28 +0900 Subject: [PATCH] register muse of vip at tv profile Libresourced provide one API proc_stat_set_vip_process() for VIP process which launches later than resourced - Only systemd and resourced is allowed to write oom_score_adj, otherwise LMN driver function is called Change-Id: I2fc7cebbf2042159c2943c5a148cf0c25a77ef5e --- CMakeLists.txt | 9 +++++++++ packaging/mused.spec | 15 ++++++++++----- src/muse_core.c | 8 ++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f600ae..d938b46 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,12 @@ SET(BINDIR "${PREFIX}/bin") SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) +IF(${MUSE_REGISTER_VIP}) +SET(dependents "dlog mm-common json-c glib-2.0 gio-2.0 capi-base-common gmodule-2.0 iniparser gstreamer-1.0 libtbm cynara-client cynara-creds-socket cynara-session libresourced") +ELSE(${MUSE_REGISTER_VIP}) SET(dependents "dlog mm-common json-c glib-2.0 gio-2.0 capi-base-common gmodule-2.0 iniparser gstreamer-1.0 libtbm cynara-client cynara-creds-socket cynara-session") +ENDIF(${MUSE_REGISTER_VIP}) + SET(pc_dependents "dlog gio-2.0 mm-common capi-base-common libtbm") INCLUDE(FindPkgConfig) @@ -42,6 +47,10 @@ IF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DTARGET") ENDIF("${ARCH}" STREQUAL "arm") +IF(${MUSE_REGISTER_VIP}) + ADD_DEFINITIONS("-DMUSE_REGISTER_VIP") +ENDIF(${MUSE_REGISTER_VIP}) + ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DTIZEN_DEBUG") ADD_DEFINITIONS(-DTZ_SYS_DATA_PATH="${TZ_SYS_DATA}") diff --git a/packaging/mused.spec b/packaging/mused.spec index 3780a66..c624c17 100644 --- a/packaging/mused.spec +++ b/packaging/mused.spec @@ -1,6 +1,6 @@ Name: mused Summary: A Multimedia Daemon in Tizen Native API -Version: 0.1.26 +Version: 0.1.27 Release: 0 Group: System/Libraries License: Apache-2.0 @@ -25,7 +25,9 @@ BuildRequires: pkgconfig(cynara-creds-socket) BuildRequires: pkgconfig(cynara-session) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(gio-2.0) - +%if "%{?profile}" == "tv" +BuildRequires: pkgconfig(libresourced) +%endif Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -57,12 +59,15 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE" export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE -D_GNU_SOURCE" %endif +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` + %if "%{?profile}" == "tv" export CFLAGS+=" -DMUSE_NO_LOG" -%endif - -MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +export CFLAGS+=" -DMUSE_REGISTER_VIP" +cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIBDIR=%{_libdir} -DTZ_SYS_DATA=%TZ_SYS_DATA -DMUSE_REGISTER_VIP=1 +%else cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIBDIR=%{_libdir} -DTZ_SYS_DATA=%TZ_SYS_DATA +%endif make %{?jobs:-j%jobs} diff --git a/src/muse_core.c b/src/muse_core.c index 673440d..e4ae0cd 100644 --- a/src/muse_core.c +++ b/src/muse_core.c @@ -30,6 +30,10 @@ #include "muse_core_security.h" #include "muse_core_tool.h" +#ifdef MUSE_REGISTER_VIP +#include +#endif + #define MUSE_LOG_SLEEP_TIMER 10 #define END_DELIM_STR " }" @@ -428,6 +432,10 @@ int muse_core_run() LOGE("Fail to create MUSE_SERVER_READY(%s)", MUSE_SERVER_READY); } +#ifdef MUSE_REGISTER_VIP + proc_stat_set_vip_process(); +#endif + LOGD("g_main_loop_run"); g_main_loop_run(g_loop); -- 2.7.4