From: Sangchul Lee Date: Mon, 5 Sep 2022 03:33:12 +0000 (+0900) Subject: CMakefile: Exclude capi-system-sensor dependency when using TIZEN_TV X-Git-Tag: accepted/tizen/unified/20220908.124830~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4d3609a4cfc45e164eefa2a499ca65d57276dd6;p=platform%2Fcore%2Fapi%2Fwebrtc.git CMakefile: Exclude capi-system-sensor dependency when using TIZEN_TV 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 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ff8924a4..a0121f51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/include/webrtc_private.h b/include/webrtc_private.h index 0f645e19..409c1489 100644 --- a/include/webrtc_private.h +++ b/include/webrtc_private.h @@ -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; diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 478fc019..b7722e9d 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -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 diff --git a/src/webrtc.c b/src/webrtc.c index dd43140f..e2c0c576 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -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 diff --git a/src/webrtc_source.c b/src/webrtc_source.c index fa36b7b8..be055039 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -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; diff --git a/src/webrtc_source_screen.c b/src/webrtc_source_screen.c index 6b929238..1d391871 100644 --- a/src/webrtc_source_screen.c +++ b/src/webrtc_source_screen.c @@ -17,8 +17,10 @@ #include "webrtc_private.h" #include "webrtc_source_private.h" #include +#ifndef TIZEN_TV #include #include +#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) {