From 2e3393e3c2970188c91b66e3a0073d8748c85431 Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Tue, 20 Sep 2022 17:34:36 +0900 Subject: [PATCH] webrtc_source: Add encoding-params(2) to caps in case of OPUS codec 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 --- packaging/capi-media-webrtc.spec | 2 +- src/webrtc_source.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 2ae3851f..ab09632c 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.2.181 +Version: 0.2.182 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_source.c b/src/webrtc_source.c index cefde50f..65eb2b98 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -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. */ -- 2.34.1