From: hj kim Date: Fri, 19 Aug 2022 01:47:51 +0000 (+0900) Subject: webrtc_source: Don't allow resolution change of encoded video format X-Git-Tag: submit/tizen/20220823.080652~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F279889%2F9;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_source: Don't allow resolution change of encoded video format This new condition is checked only when the state is not IDLE. [Version] 0.3.205 [Issue Type] Improvement(check condition) Change-Id: I25bd78a4f20615c36735c9c44b3880a1b762e895 --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 900d3211..eea71f04 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.204 +Version: 0.3.205 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_source.c b/src/webrtc_source.c index 151edf62..20573baa 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -1378,6 +1378,10 @@ int _set_video_resolution(webrtc_s *webrtc, unsigned int source_id, int width, i source->video_info.origin_width = width; source->video_info.origin_height = height; } else { + if (_is_encoded_format_supported(source->type, &webrtc->ini)) { + LOG_ERROR("this API does not support source with encoded format"); + return WEBRTC_ERROR_INVALID_OPERATION; + } RET_VAL_IF(width > source->video_info.origin_width, WEBRTC_ERROR_INVALID_OPERATION, "it doesn't support upscale. invalid width. origin [%d] requested [%d]", source->video_info.origin_width, width);