webrtc_source: Use display resolution as default resolution for screen source 57/276657/6 accepted/tizen/unified/20220628.133453 submit/tizen/20220628.064755
authorhj kim <backto.kim@samsung.com>
Thu, 23 Jun 2022 01:56:44 +0000 (10:56 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 27 Jun 2022 07:12:02 +0000 (16:12 +0900)
To transmit a screen with the same display ratio as the actual display,
sets the actual display resolution to the default.

[Version] 0.3.135
[Issue Type] Improvement

Change-Id: I1c6c855ebc66944e3d25acec210e3ddb69b859d7

CMakeLists.txt
packaging/capi-media-webrtc.spec
src/webrtc_source.c

index 569d11bd807c5afe68552bfeeec3395823052c6e..e1a3e194505bd7fa740eccfff406eca111a68ce4 100644 (file)
@@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES(${INC_DIR})
 
 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")
+                libtbm libwebsockets cynara-client libsmack capi-system-info libsoup-2.4 bundle capi-media-sound-manager elementary")
 IF(NOT TIZEN_PROFILE_TV)
     SET(dependents "${dependents} mm-resource-manager")
 ELSE()
index cfe4408583876d815430fc626e8b451bf86b7a6e..21315a2fe83d2997486e1bdce2da40e675a8aa5e 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.134
+Version:    0.3.135
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 9a7eb58e52ae8d653bb1e7cbef83733b4854dee8..ce32dbebe54c782def4ea67e8b68173c674b0b7c 100644 (file)
@@ -20,6 +20,7 @@
 #include <tbm_surface_internal.h>
 #include <media_packet_internal.h>
 #include <gst/allocators/gsttizenmemory.h>
+#include <Elementary.h>
 
 #define GST_KLASS_NAME_ENCODER_AUDIO   "Codec/Encoder/Audio"
 #define GST_KLASS_NAME_ENCODER_VIDEO   "Codec/Encoder/Video"
@@ -1348,6 +1349,29 @@ static bool __set_default_video_info(webrtc_gst_slot_s *source, const ini_item_m
        source->video_info.width = ini_source->v_width;
        source->video_info.height = ini_source->v_height;
 
+       if (source->type == WEBRTC_MEDIA_SOURCE_TYPE_SCREEN) {
+               Evas_Object *eo = NULL;
+               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;
+               }
+
+               source->video_info.width = width;
+               source->video_info.height = height;
+       }
+
        return true;
 }