From a13e8c5a10ae6e09a328b22441e919e509a82b3f Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Thu, 16 Feb 2023 15:14:33 +0900 Subject: [PATCH] webrtcbin: Post error message when a RTP session ssrc timeout happens If rtp session emits this notification with session_id and ssrc, forwards it to let a user know this situation via message. Change-Id: I49b63f34f6ea4033e6d63f6b5bfc80ed2123ffc5 --- packaging/gstreamer.spec | 2 +- subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 17 +++++++++++++++++ subprojects/gst-plugins-bad/meson.build | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 0543f4a..9d4ffc9 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -62,7 +62,7 @@ Name: %{_name} Version: 1.22.0 -Release: 12 +Release: 13 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c index 607195f..b7054fd 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c @@ -7759,6 +7759,20 @@ on_rtpbin_ssrc_validated (GstElement * rtpbin, guint session_id, guint ssrc, GST_INFO_OBJECT (webrtc, "session %u ssrc %u validated", session_id, ssrc); } +#ifdef TIZEN_FEATURE_WEBRTC_SSRC_TIMEOUT_NOTIFICATION +static void +post_ssrc_timeout_error_msg (GstWebRTCBin *webrtc, guint ssrc) +{ + GError *err = g_error_new (GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_TOO_LAZY, "RTP session ssrc timeout happened"); + gchar *debug = g_strdup_printf("timeout on ssrc %u", ssrc); + GstMessage *msg = gst_message_new_error (GST_OBJECT_CAST (webrtc), err, debug); + g_free (debug); + g_error_free (err); + + gst_element_post_message (GST_ELEMENT_CAST (webrtc), msg); +} +#endif + static void on_rtpbin_timeout (GstElement * rtpbin, guint session_id, guint ssrc, GstWebRTCBin * webrtc) @@ -7767,6 +7781,9 @@ on_rtpbin_timeout (GstElement * rtpbin, guint session_id, guint ssrc, PC_LOCK (webrtc); remove_ssrc_entry_by_ssrc (webrtc, session_id, ssrc); +#ifdef TIZEN_FEATURE_WEBRTC_SSRC_TIMEOUT_NOTIFICATION + post_ssrc_timeout_error_msg (webrtc, ssrc); +#endif PC_UNLOCK (webrtc); } diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index 815dbb8..d85ead2 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -503,6 +503,7 @@ cdata.set('TIZEN_FEATURE_HLSDEMUX_LANG_TAG', true) cdata.set('TIZEN_FEATURE_HLSDEMUX_DISCONT', true) cdata.set('TIZEN_FEATURE_WEBRTC_MODIFICATION', true) cdata.set('TIZEN_FEATURE_WEBRTC_IMPORT_NETSIM', true) +cdata.set('TIZEN_FEATURE_WEBRTC_SSRC_TIMEOUT_NOTIFICATION', true) cdata.set('TIZEN_FEATURE_PITCH_AUDIO_META', true) cdata.set('TIZEN_FEATURE_SRT_LATENCY', true) if get_option('tv-profile') -- 2.7.4