From ec6080e19c9659ecd1edeefd0e57252030e44129 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Mon, 14 Nov 2016 16:28:49 +0900 Subject: [PATCH] Remove Profile Build Dependency: Do it at runtime - This is for Tizen 4.0. : Tizen 4.0 Configurability and Build Blocks require to remove all profile-depending build options in spec files. (No More profile macros) - It is recommended to distinguish features/profiles at runtime. unless it incurs too much overhead, which requires you to create multiple binaries and subpackages. Change-Id: Iad4bd14dc3bdecdf1b5b9814969223aacc260402 Signed-off-by: MyungJoo Ham --- configure.ac | 4 ++++ packaging/libmm-player.spec | 4 +--- src/Makefile.am | 6 ++++-- src/mm_player_priv.c | 20 +++++++++++++++++--- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index b2a745d..89c923d 100644 --- a/configure.ac +++ b/configure.ac @@ -133,6 +133,10 @@ PKG_CHECK_MODULES(DLOG, dlog) AC_SUBST(DLOG_CFLAGS) AC_SUBST(DLOG_LIBS) +PKG_CHECK_MODULES(SYSTEMINFO, capi-system-info) +AC_SUBST(SYSTEMINFO_CFLAGS) +AC_SUBST(SYSTEMINFO_LIBS) + AC_ARG_ENABLE(sdk, AC_HELP_STRING([--enable-sdk], [sdk build]), [ case "${enableval}" in diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 5e73f39..4fb0439 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -27,6 +27,7 @@ BuildRequires: pkgconfig(icu-i18n) BuildRequires: pkgconfig(capi-media-tool) BuildRequires: pkgconfig(murphy-resource) BuildRequires: pkgconfig(murphy-glib) +BuildRequires: pkgconfig(capi-system-info) %description Multimedia Framework Player Library files. @@ -48,9 +49,6 @@ export CFLAGS+=" -Wall -DTIZEN_DEBUG -D_FILE_OFFSET_BITS=64 -DSYSCONFDIR=\\\"%{_ %if %{with x} export CFLAGS+=" -DHAVE_X11" %endif -%if "%{?profile}" == "tv" -export CFLAGS+=" -DTIZEN_TV" -%endif LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed"; export LDFLAGS ./autogen.sh diff --git a/src/Makefile.am b/src/Makefile.am index 8314d5e..b2d775c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -38,6 +38,7 @@ libmmfplayer_la_CFLAGS = -I$(srcdir)/include \ $(DLOG_CFLAGS) \ $(EVAS_CFLAGS) \ $(ECORE_CFLAGS) \ + $(SYSTEMINFO_CFLAGS) \ -Werror -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp noinst_HEADERS = include/mm_player_utils.h \ @@ -68,7 +69,8 @@ libmmfplayer_la_LIBADD = $(GST_LIBS) \ $(DLOG_LIBS) \ $(UTILX_LIBS) \ $(EVAS_LIBS) \ - $(ECORE_LIBS) + $(ECORE_LIBS) \ + $(SYSTEMINFO_LIBS) if IS_SDK @@ -78,4 +80,4 @@ endif if WAYLAND_SUPPORT libmmfplayer_la_CFLAGS += $(GST_WAYLAND_CFLAGS) libmmfplayer_la_LIBADD += $(GST_WAYLAND_LIBS) -endif \ No newline at end of file +endif diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index bec94d9..a30f508 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -51,6 +51,8 @@ #include "mm_player_utils.h" #include "mm_player_tracks.h" +#include + /*=========================================================================================== | | | LOCAL DEFINITIONS AND DECLARATIONS FOR MODULE | @@ -11066,6 +11068,7 @@ __mmplayer_verify_next_play_path(mm_player_t *player) gint count = 0; gint gapless = 0; guint num_of_list = 0; + static int profile_tv = -1; MMPLAYER_FENTER(); @@ -11084,13 +11087,24 @@ __mmplayer_verify_next_play_path(mm_player_t *player) mm_attrs_get_int_by_name(attrs, "content_video_found", &video); -#ifdef TIZEN_TV + if (__builtin_expect(profile_tv == -1, 0)) { + char *profileName; + system_info_get_platform_string("http://tizen.org/feature/profile", &profileName); + switch (*profileName) { + case 't': + case 'T': + profile_tv = 1; + break; + default: + profile_tv = 0; + } + free(profileName); + } /* gapless playback is not supported in case of video at TV profile. */ - if (video) { + if (profile_tv && video) { LOGW("not support video gapless playback"); goto ERROR; } -#endif if (mm_attrs_get_int_by_name(attrs, "pd_mode", &mode) == MM_ERROR_NONE) { if (mode == TRUE) { -- 2.7.4