fixup! webrtc_source: Revise assigning payload identifier 80/260480/3
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 25 Jun 2021 09:29:47 +0000 (18:29 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 28 Jun 2021 07:21:58 +0000 (16:21 +0900)
Change-Id: I8d4800349ae895c5acc1eeb308f7f165c5cbc672
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/webrtc_source.c

index 025ecbe39c50b755c884a1ad9bbc35b7e72a8e39..3560b406037387c4089af553748c6954cff870fa 100644 (file)
@@ -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);
        }