setting the default video resolution to screen resolution is only required for screen source.
[Version] 0.3.251
[Issue Type] Refactoring
Change-Id: I25dbf22a6d8a8469705e6fee7c69bbd1369b2a32
/* screen source */
int _build_screensrc(webrtc_s *webrtc, webrtc_gst_slot_s *source);
-int _get_screen_resolution(int *width, int *height);
void _unset_screen_rotation_changed_cb(webrtc_s *webrtc);
int _set_screen_source_crop(webrtc_s *webrtc, unsigned int source_id, int x, int y, int width, int height);
int _unset_screen_source_crop(webrtc_s *webrtc, unsigned int source_id);
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.3.250
+Version: 0.3.251
Release: 0
Group: Multimedia/API
License: Apache-2.0
source->video_info.width = width;
source->video_info.height = height;
+
+ LOG_DEBUG("video resolution is updated. width[%d] height[%d]", width, height);
}
GstCaps *_make_video_raw_caps_with_resolution(webrtc_gst_slot_s *source, webrtc_ini_s *ini, int width, int height)
source->video_info.origin_height = ini_source->v_height;
_set_video_src_resolution(source, ini_source->v_width, ini_source->v_height);
- if (source->type == WEBRTC_MEDIA_SOURCE_TYPE_SCREEN) {
-#ifdef TIZEN_FEATURE_UI
- int width = 0;
- int height = 0;
-
- 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.origin_width = width;
- source->video_info.origin_height = height;
- _set_video_src_resolution(source, width, height);
-#else
- LOG_WARNING("TIZEN_FEATURE_UI is disabled, skip this function, use values of ini");
-#endif
- }
return true;
}
return WEBRTC_ERROR_NONE;
}
-int _get_screen_resolution(int *width, int *height)
+static int __get_screen_resolution(int *width, int *height)
{
int mm_ret;
mm_display_interface_h mm_display;
return true;
}
+static void __update_video_resolution(webrtc_gst_slot_s *source)
+{
+ int width = 0;
+ int height = 0;
+
+ RET_IF(source == NULL, "source is NULL");
+ RET_IF(__get_screen_resolution(&width, &height) != WEBRTC_ERROR_NONE, "failed to __get_screen_resolution()");
+ RET_IF(width == 0, "width is 0");
+ RET_IF(height == 0, "height is 0");
+
+ source->video_info.origin_width = width;
+ source->video_info.origin_height = height;
+
+ _set_video_src_resolution(source, width, height);
+}
+
int _build_screensrc(webrtc_s *webrtc, webrtc_gst_slot_s *source)
{
int ret;
if (!_set_default_video_info(source, ini_source))
return WEBRTC_ERROR_INVALID_OPERATION;
+ __update_video_resolution(source);
+
#ifndef TIZEN_TV
if (!webrtc->rotate_info.sensor_listener)
if ((ret = __set_screen_rotation_changed_cb(webrtc)) != WEBRTC_ERROR_NONE)