Apply build option for tizen 6.0 only 28/305228/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 23 Jan 2024 03:22:52 +0000 (12:22 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 30 Jan 2024 07:00:03 +0000 (07:00 +0000)
For rpm spec file, 'use_tizen_6.0' define has been added.
And it corresponds to 'tizen-60' meson option that represents
'USE_TIZEN_60' definition in the codes.

If 'ST_AVP_TIZEN_70' definition given by SES build script
is set while it is compiling, 'USE_TIZEN_60' will be unset.

[Version] 0.3.15

Change-Id: I72d537320b0f486fe0f0d6dfa466488554334389
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
(cherry picked from commit f84dc3a0dc1c3973a8e280236332f4b6624062e7)

meson_options.txt
packaging/espp-service.spec
project_def.prop
src/client/project_def.prop
src/daemon/espp_service_handler.c
src/daemon/espp_service_priv.h
src/daemon/meson.build
tizen-manifest.xml

index 6fc371f363356c49e96c1e128bee81d8fefd8980..42c2cc3a0046a5daf5cc8a278e1f6024d84c3e03 100644 (file)
@@ -3,5 +3,6 @@ option('sock-path', type: 'string', value: '/tmp/espp_service.sock', description
 option('dlog', type: 'boolean', value: true, description: 'Use dlog')
 
 #daemon
+option('tizen-60', type: 'boolean', value: false, description: 'For tizen 6.0')
 option('_bindir', type: 'string', value: '/usr/bin', yield: true, description: 'ESPP service daemon install dir')
 option('service-app', type: 'boolean', value: true, yield: true, description: 'ESPP service daemon is launched as Tizen service app')
index 140217873644cd7286c289d0eaef49a9cb6e6a97..5d9883d8cde098dc674e4f0e9203c67858fadc2c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       espp-service
 Summary:    ESPP service package which contains client lib. and daemon binary
-Version:    0.3.14
+Version:    0.3.15
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
@@ -16,10 +16,12 @@ BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(gio-2.0)
 BuildRequires: pkgconfig(json-glib-1.0)
 BuildRequires: pkgconfig(esplusplayer)
+%if "%{use_tizen_60}" != "1"
 BuildRequires: pkgconfig(libtbm)
 BuildRequires: pkgconfig(mm-common)
 BuildRequires: pkgconfig(mmutil-common)
 BuildRequires: pkgconfig(mmutil-imgp)
+%endif
 %if "%{use_service_app}" == "1"
 BuildRequires: pkgconfig(capi-appfw-service-application)
 BuildRequires: pkgconfig(capi-appfw-application)
@@ -54,6 +56,11 @@ meson setup --auto-features=disabled \
   --prefix=/usr \
   --libdir=%{_libdir} \
   --datadir=%{_datadir} \
+%if "%{use_tizen_60}" == "1"
+  -Dtizen-60=true \
+%else
+  -Dtizen-60=false \
+%endif
   -Dsock-path=/tmp/espp_service.sock \
 %if "%{use_service_app}" == "1"
   -Dservice-app=true \
index 3d7cae92252c74d13d9e7d3687b03c7c2b6d4b7a..3c93d8c043ab53f6a19de00cf1bd97817e019186 100644 (file)
@@ -11,7 +11,7 @@ profile = mobile-7.0
 USER_SRCS = ./src/daemon/*.c ./src/common/*.c
 
 # User Defines
-USER_DEFS = USE_DLOG USE_SERVICE_APP ESPP_SERVICE_VERSION="0.3.14"
+USER_DEFS = USE_DLOG USE_SERVICE_APP ESPP_SERVICE_VERSION="0.3.15"
 
 # User Includes
 USER_INC_DIRS = ./src/daemon ./src/common ./inc ./inc/esplusplayer_capi
index cb338e4b45f638dc89ca36f9368583854cd0d9f0..f7f3e726be017c43a12e58fd61d4ebc89c124ac0 100644 (file)
@@ -11,7 +11,7 @@ profile = mobile-7.0
 USER_SRCS = ../common/*.c ./*.c
 
 # User Defines
-USER_DEFS = USE_DLOG USE_SERVICE_APP ESPP_SERVICE_VERSION="0.3.14"
+USER_DEFS = USE_DLOG USE_SERVICE_APP ESPP_SERVICE_VERSION="0.3.15"
 
 # User Includes
 USER_INC_DIRS = ../common ./
index 2acaf2b495bbe2ccb81366949d109f56f7b20137..7e116191aecb7eb7ee17c87d6644bb01df03768e 100644 (file)
 #include <esplusplayer_capi.h>
 #include <esplusplayer_internal.h>
 #include <inttypes.h>
+#ifndef USE_TIZEN_60
 #include <tbm_surface.h>
 #include <mm_util_image.h>
 #include <mm_util_imgp.h>
 #include <mm_error.h>
+#endif
 
 #define USECONDS_TO_MSECONDS(usec) ((usec) / G_GINT64_CONSTANT (1000))
 #define C(b,m)              (((b) >> (m)) & 0xFF)
@@ -29,8 +31,9 @@
 
 typedef int (*set_cb_func) (esplusplayer_handle handle, void *callback, void *user_data);
 typedef void (*func_handler) (handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result);
-
+#ifndef USE_TIZEN_60
 static gpointer __snapshot_work_thread(gpointer data);
+#endif
 
 typedef struct {
        set_cb_func set_cb;
@@ -46,7 +49,7 @@ typedef struct {
                GAsyncQueue *queue;
        } snapshot;
 } tb_data_s;
-
+#ifndef USE_TIZEN_60
 typedef struct {
        int32_t id;
        uint32_t width;
@@ -54,6 +57,7 @@ typedef struct {
        uint32_t size;
        unsigned char *data;
 } snapshot_data_s;
+#endif
 
 static void __handle_init_event(handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result)
 {
@@ -77,6 +81,7 @@ static void __handle_init_event(handler_userdata_s *hdata, espp_service_data_fro
        result->ret = 0;
 }
 
+#ifndef USE_TIZEN_60
 typedef struct {
        int cb_id;
        bool exit;
@@ -129,6 +134,7 @@ static void __deinit_snapshot_thread(tb_data_s *tbs)
        tbs->snapshot.queue = NULL;
        tbs->snapshot.thread = NULL;
 }
+#endif
 
 static void __handle_create(handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result)
 {
@@ -161,12 +167,13 @@ static void __handle_create(handler_userdata_s *hdata, espp_service_data_from_cl
                esplusplayer_destroy(espp);
                return;
        }
-
+#ifndef USE_TIZEN_60
        if (__init_snapshot_thread(tbs) != 0) {
                g_hash_table_remove(hdata->svc->fd_table, hdata->key);
                esplusplayer_destroy(espp);
                return;
        }
+#endif
 
        result->ret = 0;
 }
@@ -183,8 +190,9 @@ static void __handle_destroy(handler_userdata_s *hdata, espp_service_data_from_c
        LOG_INFO("fd[%d]: esplusplayer_destroy() success", hdata->fd);
 
        ASSERT(g_hash_table_steal(hdata->svc->fd_table, hdata->key));
-
+#ifndef USE_TIZEN_60
        __deinit_snapshot_thread(tbs);
+#endif
 
        result->ret = 0;
 }
@@ -724,7 +732,7 @@ static void __handle_set_low_latency_mode(handler_userdata_s *hdata, espp_servic
 static void __handle_set_decoded_video_frame_buffer_type(handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result)
 {
        int ret;
-       esplusplayer_decoded_video_frame_buffer_type type;
+       int type;
 
        result->ret = -1;
 
@@ -734,16 +742,20 @@ static void __handle_set_decoded_video_frame_buffer_type(handler_userdata_s *hda
        if (ret != 0)
                return;
 
-       ret = esplusplayer_set_video_frame_buffer_type((esplusplayer_handle)hdata->espp, type);
+#ifdef USE_TIZEN_60
+       LOG_WARNING("It's not supported because it's built with tizen 6.0");
+#else
+       ret = esplusplayer_set_video_frame_buffer_type((esplusplayer_handle)hdata->espp, (esplusplayer_decoded_video_frame_buffer_type)type);
        RET_IF(ret != ESPLUSPLAYER_ERROR_TYPE_NONE, "failed to esplusplayer_set_video_frame_buffer_type(), ESPP[%p], type[%d]",
                hdata->espp, type);
-
        LOG_INFO("fd[%d], ESPP[%p]: esplusplayer_set_video_frame_buffer_type() success, type[%d]",
                hdata->fd, hdata->espp, type);
+#endif
 
        result->ret = 0;
 }
 
+#ifndef USE_TIZEN_60
 static int __convert_colorspace(unsigned char *src_data, size_t src_size, int src_w, int src_h, mm_util_color_format_e src_fmt, mm_util_color_format_e dst_fmt, snapshot_data_s *result)
 {
        int ret;
@@ -970,29 +982,35 @@ static gpointer __snapshot_work_thread(gpointer data)
        LOG_DEBUG("exit");
        return NULL;
 }
+#endif
 
 static void __handle_take_snapshot(handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result)
 {
        int ret;
        int id;
        tb_data_s *tbs;
+#ifndef USE_TIZEN_60
        queue_data_s *qd;
+#endif
 
        result->ret = -1;
 
        RET_IF(!(tbs = g_hash_table_lookup(hdata->svc->fd_table, hdata->key)), "failed to g_hash_table_lookup(), key[%s]", hdata->key);
 
+#ifndef USE_TIZEN_60
        ASSERT(tbs->snapshot.queue);
-
+#endif
        ret = espp_service_msg_parse_params(data->params, data->request, &id);
        if (ret != 0)
                return;
-
+#ifdef USE_TIZEN_60
+       LOG_WARNING("It's not supported because it's built with tizen 6.0");
+#else
        qd = g_new0(queue_data_s, 1);
        qd->cb_id = id;
        g_async_queue_push(tbs->snapshot.queue, qd);
-
        LOG_INFO("qd[%p, cb_id:%d]", qd, id);
+#endif
 
        result->ret = 0;
 }
@@ -1010,14 +1028,16 @@ static void __handle_set_render_time_offset(handler_userdata_s *hdata, espp_serv
        ret = espp_service_msg_parse_params(data->params, data->request, &stream_type, &time_offset_ms);
        if (ret != 0)
                return;
-
+#ifdef USE_TIZEN_60
+       LOG_WARNING("It's not supported because it's built with tizen 6.0");
+#else
        ret = esplusplayer_set_render_time_offset((esplusplayer_handle)hdata->espp, stream_type, time_offset_ms);
        RET_IF(ret != ESPLUSPLAYER_ERROR_TYPE_NONE,
                "failed to esplusplayer_set_render_time_offset(), ESPP[%p], stream_type[%d], time_offset_ms[%" PRId64 "]",
                hdata->espp, stream_type, time_offset_ms);
-
        LOG_INFO("fd[%d], ESPP[%p]: esplusplayer_set_render_time_offset() success, stream_type[%d], time_offset_ms[%" PRId64 "]",
                hdata->fd, hdata->espp, stream_type, time_offset_ms);
+#endif
 
        result->ret = 0;
 }
index cbf267f504f0d88199c1445b969d30e7b967d90d..4e4a384ce00074ebd9141f919732801e55c5b1b6 100644 (file)
 #include "../common/espp_service_common.h"
 #include "../common/espp_service_ipc.h"
 
+#ifdef ST_AVP_TIZEN_70
+#ifdef USE_TIZEN_60
+#undef USE_TIZEN_60
+#endif
+#endif
+
 #ifdef USE_DLOG
 #ifdef LOG_TAG
 #undef LOG_TAG
index 59597382b73e3b96f7941ef123b7ae93aad86247..409ddc36861290486eb0f582db6adc7377c69eb3 100644 (file)
@@ -9,6 +9,16 @@ espp_service_sources = [
 daemon_deps = common_deps
 
 message('================ daemon options ================')
+if get_option('tizen-60')
+  message('tizen-6.0 option is enabled, set USE_TIZEN_60')
+  conf_data.set('USE_TIZEN_60', true)
+else
+  tbm_dep = dependency('libtbm', required: true)
+  mm_common_dep = dependency('mm-common', required: true)
+  mm_util_dep = dependency('mmutil-common', required: true)
+  mmutil_imgp_dep = dependency('mmutil-imgp', required: true)
+  daemon_deps += [tbm_dep, mm_common_dep, mm_util_dep, mmutil_imgp_dep]
+endif
 message('bindir: '+ get_option('_bindir'))
 if get_option('service-app')
   message('service-app option is enabled, set USE_SERVICE_APP')
@@ -21,12 +31,8 @@ message('================================================')
 
 thread_dep = dependency('threads', required: true)
 espp_dep = dependency('esplusplayer', required: true)
-tbm_dep = dependency('libtbm', required: true)
-mm_common_dep = dependency('mm-common', required: true)
-mm_util_dep = dependency('mmutil-common', required: true)
-mmutil_imgp_dep = dependency('mmutil-imgp', required: true)
 
-daemon_deps += [thread_dep, espp_dep, tbm_dep, mm_common_dep, mm_util_dep, mmutil_imgp_dep]
+daemon_deps += [thread_dep, espp_dep]
 
 executable('espp-service',
   espp_service_sources,
index c8bbda7d2f838eedc9381a8ca0719fcc57551df3..85c489f191b6e233ac00cf5084dea84416febbc1 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="7.0" package="com.samsung.tizen.espp-service" version="0.3.14">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="7.0" package="com.samsung.tizen.espp-service" version="0.3.15">
     <profile name="mobile"/>
     <description>espp-service</description>
     <service-application appid="com.samsung.tizen.espp-service" auto-restart="false" exec="espp-service" multiple="false" nodisplay="false" on-boot="false" taskmanage="false" type="capp">