webrtc_source_screen: Use mm_display_interface_get_screen_size() instead of elm_win_s... 38/281038/2
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 8 Sep 2022 07:30:04 +0000 (16:30 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 13 Sep 2022 02:08:25 +0000 (11:08 +0900)
This will remove the dependency of elementary lib.

[Version] 0.3.236
[Issue Type] Dependency

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

index a0121f5185219db3f3a26c895e080c5a4b735330..c83df6d82447bc9f724d0b92fa74c4b18859f3a3 100644 (file)
@@ -22,7 +22,6 @@ ELSE()
     ADD_DEFINITIONS("-DTIZEN_TV")
 ENDIF()
 IF(TIZEN_FEATURE_UI)
-    SET(dependents "${dependents} elementary")
     ADD_DEFINITIONS("-DTIZEN_FEATURE_UI")
 ENDIF()
 
@@ -57,7 +56,6 @@ 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})
@@ -77,7 +75,6 @@ INSTALL(
         PATTERN "${INC_DIR}/*.h"
 )
 
-
 SET(PC_NAME ${fw_name})
 SET(PC_REQUIRED ${pc_dependents})
 SET(PC_LDFLAGS -l${fw_name})
index 01ce9a7d77fcfb4b3349d420770441f7e7b29a4b..84ec88cd87180d08a08b0d6a25e63c1f809a5150 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.235
+Version:    0.3.236
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 9c4e230ea1512de657c5b25293c41e85a2edd152..ec29f1933be050b40c7dda3fbea3aee876680a93 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "webrtc_private.h"
 #include "webrtc_source_private.h"
-#include <Elementary.h>
+#include <mm_error.h>
 #ifndef TIZEN_TV
 #include <sensor.h>
 #include <sensor-internal.h>
@@ -147,26 +147,23 @@ int _unset_screen_source_crop(webrtc_s *webrtc, unsigned int source_id)
 
 int _get_screen_resolution(int *width, int *height)
 {
-       Evas_Object *eo;
-       int _width;
-       int _height;
+       int mm_ret;
+       mm_display_interface_h mm_display;
 
        RET_VAL_IF(width == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "width is NULL");
        RET_VAL_IF(height == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "height is NULL");
 
-       /* This function returns the resolution when the device rotation angle is "0" regardless of the actual rotation direction of the device. */
+       mm_ret = mm_display_interface_init(&mm_display);
+       RET_VAL_IF(mm_ret != MM_ERROR_NONE, WEBRTC_ERROR_INVALID_OPERATION, "failed to mm_display_interface_init()");
 
-       eo = elm_win_add(NULL, "screen_source", ELM_WIN_BASIC);
-       if (!eo) {
-               LOG_ERROR("failed to elm_win_add()");
+       mm_ret = mm_display_interface_get_screen_size(mm_display, width, height);
+       mm_display_interface_deinit(mm_display);
+       if (mm_ret != MM_ERROR_NONE) {
+               LOG_ERROR("failed to mm_display_interface_get_screen_size(), mm_ret[0x%x]", mm_ret);
                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;
+       LOG_DEBUG("screen size: %d x %d", *width, *height);
 
        return WEBRTC_ERROR_NONE;
 }