CMakefile: Exclude capi-system-sensor dependency when using TIZEN_TV 73/280773/2
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 5 Sep 2022 03:33:12 +0000 (12:33 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 5 Sep 2022 03:38:44 +0000 (12:38 +0900)
sensor-internal.h could not be found with tv build.
(it is found by QB.)

[Version] 0.3.230
[Issue Type] Build dependency

Change-Id: I56c0eb28b251d3de9a701f31d326a42dd4d8d6ca
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
CMakeLists.txt
include/webrtc_private.h
packaging/capi-media-webrtc.spec
src/webrtc.c
src/webrtc_source.c
src/webrtc_source_screen.c

index ff8924a40ad2c18471402e4b649c2ed496dcd488..a0121f5185219db3f3a26c895e080c5a4b735330 100644 (file)
@@ -15,11 +15,14 @@ SET(dependents "dlog glib-2.0 gstreamer-1.0 gstreamer-webrtc-1.0 gstreamer-video
                 libtbm libwebsockets cynara-client libsmack capi-system-info libsoup-2.4 bundle capi-media-sound-manager mm-fileinfo")
 IF(NOT TIZEN_PROFILE_TV)
     SET(dependents "${dependents} mm-resource-manager")
+    IF(TIZEN_FEATURE_UI)
+        SET(dependents "${dependents} capi-system-sensor")
+    ENDIF()
 ELSE()
     ADD_DEFINITIONS("-DTIZEN_TV")
 ENDIF()
 IF(TIZEN_FEATURE_UI)
-    SET(dependents "${dependents} elementary capi-system-sensor")
+    SET(dependents "${dependents} elementary")
     ADD_DEFINITIONS("-DTIZEN_FEATURE_UI")
 ENDIF()
 
index 0f645e19df75476e6594edbc40e4e86c45b28116..409c1489c8a3a7830dbcb35e18d9ccdefd394d97 100644 (file)
@@ -522,10 +522,10 @@ typedef struct _webrtc_s {
        webrtc_negotiation_states_s negotiation_states;
 #ifndef TIZEN_TV
        webrtc_resource_s resource;
-#endif
 #ifdef TIZEN_FEATURE_UI
-       void *rotate_sensor_listener;
        int screen_rotated;
+       void *rotate_sensor_listener;
+#endif
 #endif
 } webrtc_s;
 
index 478fc0199f47ee6e373748e8ece8a123894be4df..b7722e9d9c765a326b79e93e4cb46def07f185bd 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.229
+Version:    0.3.230
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
@@ -32,12 +32,12 @@ BuildRequires:  pkgconfig(libwebsockets)
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(libsmack)
 BuildRequires:  pkgconfig(capi-system-info)
-BuildRequires:  pkgconfig(capi-system-sensor)
 BuildRequires:  pkgconfig(capi-media-sound-manager)
 BuildRequires:  pkgconfig(bundle)
 BuildRequires:  pkgconfig(mm-fileinfo)
 %if "%{tizen_profile_name}" != "tv"
 BuildRequires:  pkgconfig(mm-resource-manager)
+BuildRequires:  pkgconfig(capi-system-sensor)
 BuildRequires:  pkgconfig(esplusplayer)
 %endif
 
index dd43140fa39e502c0c5d0d7fbdfc6ec9cc888744..e2c0c576357d7f19b0bf8d3791d2133492c21efd 100644 (file)
@@ -161,7 +161,7 @@ int webrtc_destroy(webrtc_h webrtc)
        _gst_destroy_pipeline(_webrtc);
        _unload_ini(_webrtc);
 
-#ifdef TIZEN_FEATURE_UI
+#if !defined(TIZEN_TV) && defined(TIZEN_FEATURE_UI)
        if (_webrtc->rotate_sensor_listener)
                _unset_screen_rotation_changed_cb(_webrtc);
 #endif
index fa36b7b885881d3e957aab1c8f320b585c7bc550..be055039cc33557bf2757bc4c0c3bdb1cb4dd3d8 100644 (file)
@@ -142,7 +142,7 @@ static int __build_screensrc(webrtc_s *webrtc, webrtc_gst_slot_s *source)
        if (!__set_default_video_info(source, ini_source))
                return WEBRTC_ERROR_INVALID_OPERATION;
 
-#ifdef TIZEN_FEATURE_UI
+#if !defined(TIZEN_TV) && defined(TIZEN_FEATURE_UI)
        if (!webrtc->rotate_sensor_listener)
                if ((ret = _set_screen_rotation_changed_cb(webrtc)) != WEBRTC_ERROR_NONE)
                        return ret;
index 6b929238f2aa8bf15ce1ba2cca750167a6a20210..1d391871723da202dd0517a13db4e5c6601d26bb 100644 (file)
 #include "webrtc_private.h"
 #include "webrtc_source_private.h"
 #include <Elementary.h>
+#ifndef TIZEN_TV
 #include <sensor.h>
 #include <sensor-internal.h>
+#endif
 
 //LCOV_EXCL_START
 int _set_screen_source_crop(webrtc_s *webrtc, unsigned int source_id, int x, int y, int w, int h, int *width, int *height)
@@ -31,6 +33,11 @@ int _set_screen_source_crop(webrtc_s *webrtc, unsigned int source_id, int x, int
        int _width, _height;
        float rw, rh;
        int left, right, top, bottom;
+#if !defined(TIZEN_TV) && defined(TIZEN_FEATURE_UI)
+       bool rotated = webrtc->screen_rotated;
+#else
+       bool rotated = false;
+#endif
        bool portrait_mode = true;
        int ret;
 
@@ -55,9 +62,9 @@ int _set_screen_source_crop(webrtc_s *webrtc, unsigned int source_id, int x, int
        videocrop = gst_bin_get_by_name(source->bin, ELEMENT_NAME_VIDEOCROP);
        RET_VAL_IF(videocrop == NULL, WEBRTC_ERROR_INVALID_OPERATION, "videocrop is NULL");
 
-       if ((webrtc->screen_rotated) && (source->video_info.origin_width < source->video_info.origin_height))
+       if (rotated && (source->video_info.origin_width < source->video_info.origin_height))
                portrait_mode = false;
-       else if ((!webrtc->screen_rotated) && (source->video_info.origin_width > source->video_info.origin_height))
+       else if (!rotated && (source->video_info.origin_width > source->video_info.origin_height))
                portrait_mode = false;
 
        LOG_INFO("set source crop x:%d, y:%d, width:%d, height:%d, mode:%s", x, y, w, h, (portrait_mode) ? "portrait" : "landscape");
@@ -164,6 +171,7 @@ int _get_screen_resolution(int *width, int *height)
        return WEBRTC_ERROR_NONE;
 }
 
+#ifndef TIZEN_TV
 static void __screen_rotation_changed_cb(sensor_h sensor, sensor_event_s events[], int events_count, void *user_data)
 {
        webrtc_s *webrtc = (webrtc_s *)user_data;
@@ -254,6 +262,7 @@ void _unset_screen_rotation_changed_cb(webrtc_s *webrtc)
 
        LOG_INFO("AUTO_ROTATION_SENSOR is destroyed");
 }
+#endif
 
 bool _is_screen_source_cropped(webrtc_gst_slot_s *source)
 {