Make a function to set origin video source resolution 97/281997/6
authorhj kim <backto.kim@samsung.com>
Mon, 26 Sep 2022 05:40:23 +0000 (14:40 +0900)
committerhj kim <backto.kim@samsung.com>
Tue, 27 Sep 2022 04:59:01 +0000 (13:59 +0900)
[Version] 0.3.252
[Issue Type] Refactoring

Change-Id: Ifc3a95a78c3265d34f6cb9b825ee6bc76a8ad0e5

include/webrtc_source_private.h
packaging/capi-media-webrtc.spec
src/webrtc_source.c
src/webrtc_source_private.c
src/webrtc_source_screen.c

index 40ec5b2a8672eea83457ff8c769f27e63e0e78ce..00f178362439c7614d52ad3a7579496428db566e 100644 (file)
@@ -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);
index d78e80c77b7699ac9a608dab39a5c76a3f5c34bb..175ae4980c7ad95836b07f02b284fd8e73497221 100644 (file)
@@ -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
index 6734de9b87f9a944f711f8d389186aa35acd91a5..c32fb6a9b24e2749ac958149797774dea847f9b6 100644 (file)
@@ -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);
index ca63bb834960c1ca69cb064a3e9598089cf1c742..7e7a88badf5c49e727bd440c6e544ae9ec68eada 100644 (file)
@@ -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;
index 3ee9df969ce878f31c430256006306f896068fec..1934374c1991916a541e2ae31098801ce0a01135 100644 (file)
@@ -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);
 }