webrtc_sink: Set wait-for-keyframe to rtpv8depay 78/246878/2
authorHyunil <hyunil46.park@samsung.com>
Thu, 5 Nov 2020 01:57:10 +0000 (10:57 +0900)
committerHyunil <hyunil46.park@samsung.com>
Fri, 6 Nov 2020 00:54:32 +0000 (09:54 +0900)
- If property is set, rtpvp8depay drops the buffer being depayed and wait intra frame when packet loss occurs
- Add element-added callback

[Version] 0.1.47
[Issue Type] Improvement

Change-Id: Ia1289fc3e954e42dde53e8910c4a8e94c529563c
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_sink.c

index 209103788df877b9092a0e783f213238b1adcc1b..17dab197a7f9d52cac95b8f1dd2c788c045c9622 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.1.46
+Version:    0.1.47
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 0c631dcae466c51e8bc2d1ad7fef132430647690..a07e1518d8baabb877112a9bc70e875ae1394964 100644 (file)
@@ -163,6 +163,23 @@ static void __invoke_track_added_cb(webrtc_s *webrtc, const gchar *name, gboolea
        }
 }
 
+static void __decodebin_element_added_cb(GstElement *decodebin, GstElement *element, gpointer user_data)
+{
+       gchar *factory_name = NULL;
+
+       RET_IF(decodebin == NULL, "decodebin is NULL");
+       RET_IF(element == NULL, "element is NULL");
+
+       factory_name = GST_OBJECT_NAME(gst_element_get_factory(element));
+
+       LOG_INFO("element[name: %s] was added to decodebin", GST_ELEMENT_NAME(element));
+
+       if (g_strrstr(factory_name, "rtpvp8depay")) {
+               LOG_INFO("set wait-for-keyframe to rtpvp8depay");
+               g_object_set(G_OBJECT(element), "wait-for-keyframe", TRUE, NULL);
+       }
+}
+
 static void __decodebin_pad_added_cb(GstElement *decodebin, GstPad *new_pad, gpointer user_data)
 {
        int ret = WEBRTC_ERROR_NONE;
@@ -263,6 +280,7 @@ int _add_rendering_sink_bin(webrtc_s *webrtc, GstPad *src_pad)
 
        g_signal_connect(decodebin, "pad-added", G_CALLBACK(__decodebin_pad_added_cb), webrtc);
        g_signal_connect(decodebin, "autoplug-select", G_CALLBACK(__decodebin_autoplug_select_cb), webrtc);
+       g_signal_connect(decodebin, "element-added", G_CALLBACK(__decodebin_element_added_cb), NULL);
 
        ret = _add_no_target_ghostpad_to_slot(sink, FALSE, &sink_pad);
        if (ret != WEBRTC_ERROR_NONE)