webrtc_source: Add encoding-params(2) to caps in case of OPUS codec 57/281657/1 accepted/tizen/6.5/unified/20220921.123831 submit/tizen_6.5/20220921.002546
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 20 Sep 2022 08:34:36 +0000 (17:34 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 20 Sep 2022 08:36:37 +0000 (17:36 +0900)
It represents channels.
In case of gst to gst, it worked fine without it. But in case of gst
to web, it does not work(web API failure).
It is also mandatory according to RFC7587, so it is added.

These codes are related to NULL source type with OPUS codec.

[Version] 0.2.182
[Issue Type] Improvement / Compatibility

Change-Id: I9df43b5f0091b78f4b9356d127b02ec1cc81eba0
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_source.c

index 2ae3851f9a6ceebf0c7cfffb974901413b8a159d..ab09632c82acc9fe1787c7dc5dcf4f31e94e73b4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.2.181
+Version:    0.2.182
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index cefde50ff987176fd4ad9236c68f48dc325dac62..65eb2b982b326c8d2b798517457e62e172e2eee0 100644 (file)
@@ -579,14 +579,22 @@ static GstCaps *__make_default_encoded_caps(webrtc_gst_slot_s *source, webrtc_in
 //LCOV_EXCL_START
 static GstCaps *__make_transceiver_caps(rtp_payload_info_s *payload_info, int payload_type)
 {
+       GstCaps *caps;
+
        RET_VAL_IF(payload_info == NULL, NULL, "payload_info is NULL");
 
-       return gst_caps_new_simple("application/x-rtp",
+       caps = gst_caps_new_simple("application/x-rtp",
                                "media", G_TYPE_STRING, payload_info->media_type,
                                "encoding-name", G_TYPE_STRING, payload_info->encoding_name,
                                "clock-rate", G_TYPE_INT, payload_info->clock_rate,
                                "payload", G_TYPE_INT, payload_type,
                                NULL);
+       if (payload_info->codec == WEBRTC_TRANSCEIVER_CODEC_OPUS)
+               gst_caps_set_simple(caps,
+                       "encoding-params", G_TYPE_STRING, "2",
+                       NULL);
+
+       return caps;
 }
 
 /* Use g_free() to free the media_type parameter. */