To remove the 'Elementary' dependency, pass an option of gbs build below.
--define "without_ui 1"
[Version] 0.3.160
[Issue Type] Dependency
Change-Id: I8475675970e77017ae58d691ee68bf739d58dad9
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
SET(dependents "dlog glib-2.0 gstreamer-1.0 gstreamer-webrtc-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 \
gstreamer-allocators-1.0 libpulse json-glib-1.0 iniparser mm-common mm-display-interface capi-media-tool \
- libtbm libwebsockets cynara-client libsmack capi-system-info libsoup-2.4 bundle capi-media-sound-manager elementary")
+ libtbm libwebsockets cynara-client libsmack capi-system-info libsoup-2.4 bundle capi-media-sound-manager")
IF(NOT TIZEN_PROFILE_TV)
SET(dependents "${dependents} mm-resource-manager")
ELSE()
ADD_DEFINITIONS("-DTIZEN_TV")
ENDIF()
+IF(TIZEN_FEATURE_UI)
+ SET(dependents "${dependents} elementary")
+ ADD_DEFINITIONS("-DTIZEN_FEATURE_UI")
+ENDIF()
SET(pc_dependents "capi-base-common capi-media-sound-manager capi-media-tool bundle" )
AUX_SOURCE_DIRECTORY (src MAIN_SRC)
-LIST (APPEND SOURCES
+LIST(APPEND SOURCES
${MAIN_SRC}
)
IF(TIZEN_PROFILE_TV)
- LIST (REMOVE_ITEM SOURCES src/webrtc_resource.c)
+ LIST(REMOVE_ITEM SOURCES src/webrtc_resource.c)
+ENDIF()
+IF(NOT TIZEN_FEATURE_UI)
+ LIST(REMOVE_ITEM SOURCES src/webrtc_source_screen.c)
ENDIF()
+
ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
unsigned int _get_available_payload_type(webrtc_s *webrtc);
GstCaps *_make_rtp_caps(const gchar *media_type, unsigned int payload_type, webrtc_gst_slot_s *source);
int _set_mediapacketsrc_codec_info(webrtc_s *webrtc, webrtc_gst_slot_s *source, media_format_mimetype_e mime_type);
+int _get_screen_resolution(int *width, int *height);
#endif /* __TIZEN_MEDIA_WEBRTC_SOURCE_COMMON_H__ */
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.3.159
+Version: 0.3.160
Release: 0
Group: Multimedia/API
License: Apache-2.0
-DTIZEN_PROFILE_TV=off \
%endif
%if "%{test_espp_render}" == "1"
--DTIZEN_FEATURE_ESPP=on
+-DTIZEN_FEATURE_ESPP=on \
%else
--DTIZEN_FEATURE_ESPP=off
+-DTIZEN_FEATURE_ESPP=off \
+%endif
+%if "%{without_ui}" == "1"
+-DTIZEN_FEATURE_UI=off
+%else
+-DTIZEN_FEATURE_UI=on
%endif
make %{?jobs:-j%jobs}
locker = g_mutex_locker_new(&_webrtc->mutex);
+#ifdef TIZEN_FEATURE_UI
return _set_screen_source_crop(_webrtc, source_id, x, y, w, h, portrait_mode, width, height);
+#else
+ LOG_ERROR("TIZEN_FEATURE_UI is disabled, skip this function");
+ return WEBRTC_ERROR_INVALID_OPERATION;
+#endif
}
int webrtc_screen_source_unset_crop(webrtc_h webrtc, unsigned int source_id)
locker = g_mutex_locker_new(&_webrtc->mutex);
+#ifdef TIZEN_FEATURE_UI
return _unset_screen_source_crop(_webrtc, source_id);
+#else
+ LOG_ERROR("TIZEN_FEATURE_UI is disabled, skip this function");
+ return WEBRTC_ERROR_INVALID_OPERATION;
+#endif
}
int webrtc_set_rtp_packet_drop_probability(webrtc_h webrtc, bool sender, float probability)
#include "webrtc_source_private.h"
#include <tbm_surface_internal.h>
-#include <Elementary.h>
#include <sound_manager_internal.h>
#define MIN_DYNAMIC_PAYLOAD_TYPE 96
source->video_info.height = ini_source->v_height;
if (source->type == WEBRTC_MEDIA_SOURCE_TYPE_SCREEN) {
- Evas_Object *eo = NULL;
+#ifdef TIZEN_FEATURE_UI
int width = 0;
int height = 0;
- eo = elm_win_add(NULL, "screen_source", ELM_WIN_BASIC);
- if (!eo) {
- LOG_WARNING("failed to add window to get screen size. use values of ini");
- return true;
- }
-
- elm_win_screen_size_get(eo, NULL, NULL, &width, &height);
- LOG_DEBUG("window size: %d x %d", width, height);
-
- if (width == 0 || height == 0) {
- LOG_WARNING("failed to get screen size. use values of ini");
- return true;
+ if (_get_screen_resolution(&width, &height) != WEBRTC_ERROR_NONE) {
+ if (width == 0 || height == 0) {
+ LOG_WARNING("failed to _get_screen_resolution(). use values of ini");
+ return true;
+ }
}
-
source->video_info.width = width;
source->video_info.height = height;
+#else
+ LOG_WARNING("TIZEN_FEATURE_UI is disabled, skip this function, use values of ini");
+#endif
}
-
return true;
}
if (type == WEBRTC_MEDIA_SOURCE_TYPE_NULL)
return __add_null_source(webrtc, source_id);
+#ifndef TIZEN_FEATURE_UI
+ if (type == WEBRTC_MEDIA_SOURCE_TYPE_SCREEN) {
+ LOG_ERROR("TIZEN_FEATURE_UI is disabled, screen source is not supported");
+ return WEBRTC_ERROR_INVALID_OPERATION;
+ }
+#endif
return __add_media_source(webrtc, type, source_id);
}
#include "webrtc_private.h"
#include "webrtc_source_private.h"
+#include <Elementary.h>
//LCOV_EXCL_START
int _set_screen_source_crop(webrtc_s *webrtc, unsigned int source_id, int x, int y, int w, int h, bool portrait_mode, int *width, int *height)
return WEBRTC_ERROR_NONE;
}
+int _get_screen_resolution(int *width, int *height)
+{
+ Evas_Object *eo;
+ int _width;
+ int _height;
+
+ RET_VAL_IF(width == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "width is NULL");
+ RET_VAL_IF(height == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "height is NULL");
+
+ eo = elm_win_add(NULL, "screen_source", ELM_WIN_BASIC);
+ if (!eo) {
+ LOG_ERROR("failed to elm_win_add()");
+ return WEBRTC_ERROR_INVALID_OPERATION;
+ }
+
+ elm_win_screen_size_get(eo, NULL, NULL, &_width, &_height);
+ LOG_DEBUG("window size: %d x %d", _width, _height);
+
+ *width = _width;
+ *height = _height;
+
+ return WEBRTC_ERROR_NONE;
+}
+
//LCOV_EXCL_STOP
\ No newline at end of file