From: Sangchul Lee Date: Fri, 25 Jun 2021 09:29:47 +0000 (+0900) Subject: fixup! webrtc_source: Revise assigning payload identifier X-Git-Tag: submit/tizen/20210729.023123~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25a9bfc72c5e134beded4e0476283ba71680ffdd;p=platform%2Fcore%2Fapi%2Fwebrtc.git fixup! webrtc_source: Revise assigning payload identifier Change-Id: I8d4800349ae895c5acc1eeb308f7f165c5cbc672 Signed-off-by: Sangchul Lee --- diff --git a/src/webrtc_source.c b/src/webrtc_source.c index 025ecbe3..3560b406 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -764,6 +764,7 @@ static int __create_rest_of_elements_for_encoded_format(webrtc_s *webrtc, webrtc GstCaps *sink_caps; element_info_s elem_info; gchar *media_type = NULL; + unsigned int payload_id; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL"); @@ -789,7 +790,15 @@ static int __create_rest_of_elements_for_encoded_format(webrtc_s *webrtc, webrtc g_free(media_type); return WEBRTC_ERROR_INVALID_OPERATION; } - if ((sink_caps = __make_rtp_caps(media_type, source->id))) { + + payload_id = __get_available_payload_id(webrtc); + if (payload_id == 0) { + g_free(media_type); + return WEBRTC_ERROR_INVALID_OPERATION; + } + source->av[source->media_types == MEDIA_TYPE_VIDEO ? AV_IDX_VIDEO : AV_IDX_AUDIO].payload_id = payload_id; + + if ((sink_caps = __make_rtp_caps(media_type, payload_id))) { g_object_set(G_OBJECT(*capsfilter), "caps", sink_caps, NULL); gst_caps_unref(sink_caps); }