From: hj kim Date: Mon, 26 Sep 2022 05:40:23 +0000 (+0900) Subject: Make a function to set origin video source resolution X-Git-Tag: accepted/tizen/unified/20220928.020833~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d40f0693db46f6875042c424f912e3c1894f086c;p=platform%2Fcore%2Fapi%2Fwebrtc.git Make a function to set origin video source resolution [Version] 0.3.252 [Issue Type] Refactoring Change-Id: Ifc3a95a78c3265d34f6cb9b825ee6bc76a8ad0e5 --- diff --git a/include/webrtc_source_private.h b/include/webrtc_source_private.h index 40ec5b2a..00f17836 100644 --- a/include/webrtc_source_private.h +++ b/include/webrtc_source_private.h @@ -90,6 +90,7 @@ int _create_rest_of_elements(webrtc_s *webrtc, webrtc_gst_slot_s *source, bool n int _set_encoder_element_bitrate(GstElement *encoder, int target_bitrate); int _get_encoder_element_bitrate(GstElement *encoder, int *target_bitrate); void _set_video_src_resolution(webrtc_gst_slot_s *source, int width, int height); +void _set_video_src_origin_resolution(webrtc_gst_slot_s *source, int width, int height); GstCaps *_make_video_raw_caps_with_resolution(webrtc_gst_slot_s *source, webrtc_ini_s *ini, int width, int height); void _release_request_pad(webrtc_gst_slot_s *source); bool _set_default_video_info(webrtc_gst_slot_s *source, const ini_item_media_source_s *ini_source); diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index d78e80c7..175ae498 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.251 +Version: 0.3.252 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_source.c b/src/webrtc_source.c index 6734de9b..c32fb6a9 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -841,8 +841,7 @@ int _set_video_resolution(webrtc_s *webrtc, unsigned int source_id, int width, i if (!(new_caps = _make_video_raw_caps_with_resolution(source, &webrtc->ini, width, height))) return WEBRTC_ERROR_INVALID_OPERATION; - source->video_info.origin_width = width; - source->video_info.origin_height = height; + _set_video_src_origin_resolution(source, width, height); } else { bool encoded_support; _get_video_encoded_support_from_ini(&webrtc->ini, source->type, &encoded_support); diff --git a/src/webrtc_source_private.c b/src/webrtc_source_private.c index ca63bb83..7e7a88ba 100644 --- a/src/webrtc_source_private.c +++ b/src/webrtc_source_private.c @@ -919,6 +919,16 @@ void _set_video_src_resolution(webrtc_gst_slot_s *source, int width, int height) LOG_DEBUG("video resolution is updated. width[%d] height[%d]", width, height); } +void _set_video_src_origin_resolution(webrtc_gst_slot_s *source, int width, int height) +{ + RET_IF(source == NULL, "source is NULL"); + + source->video_info.origin_width = width; + source->video_info.origin_height = height; + + LOG_DEBUG("video origin resolution is updated. origin_width[%d] origin_height[%d]", width, height); +} + GstCaps *_make_video_raw_caps_with_resolution(webrtc_gst_slot_s *source, webrtc_ini_s *ini, int width, int height) { GstCaps *caps = NULL; @@ -987,8 +997,7 @@ bool _set_default_video_info(webrtc_gst_slot_s *source, const ini_item_media_sou source->video_info.origin_framerate = ini_source->v_framerate; source->video_info.framerate = ini_source->v_framerate; - source->video_info.origin_width = ini_source->v_width; - source->video_info.origin_height = ini_source->v_height; + _set_video_src_origin_resolution(source, ini_source->v_width, ini_source->v_height); _set_video_src_resolution(source, ini_source->v_width, ini_source->v_height); return true; diff --git a/src/webrtc_source_screen.c b/src/webrtc_source_screen.c index 3ee9df96..1934374c 100644 --- a/src/webrtc_source_screen.c +++ b/src/webrtc_source_screen.c @@ -312,9 +312,7 @@ static void __update_video_resolution(webrtc_gst_slot_s *source) 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_origin_resolution(source, width, height); _set_video_src_resolution(source, width, height); }