summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-01-26 11:22:31 +0530
committerTim-Philipp Müller <tim@centricular.com>2022-01-28 10:18:02 +0000
commited327fd38f8072ee82cb95dac727cd5ccfc7a9a7 (patch)
tree88fa7866f77295ea5b12eb30b5d2cfe379e172f8
parentf2638a486a80f22cff3e8bcaf07f90b4e7138fe4 (diff)
downloadgstreamer-plugins-good-ed327fd38f8072ee82cb95dac727cd5ccfc7a9a7.tar.gz
rtspsrc: Fix critical while serializing timeout element message
The "cause" field wasn't registered as a GEnumValue, so do that. Fixes this critical in gst_structure_to_string(): `gst_value_serialize: assertion 'G_IS_VALUE (value)' failed` Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1111>
-rw-r--r--gst/rtsp/gstrtspsrc.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 2180d175e..35405bd9b 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -160,6 +160,23 @@ enum _GstRtspSrcRtcpSyncMode
RTCP_SYNC_RTP
};
+#define GST_TYPE_RTSP_SRC_TIMEOUT_CAUSE (gst_rtsp_src_timeout_cause_get_type())
+static GType
+gst_rtsp_src_timeout_cause_get_type (void)
+{
+ static GType timeout_cause_type = 0;
+ static const GEnumValue timeout_causes[] = {
+ {GST_RTSP_SRC_TIMEOUT_CAUSE_RTCP, "timeout triggered by RTCP", "RTCP"},
+ {0, NULL, NULL},
+ };
+
+ if (!timeout_cause_type) {
+ timeout_cause_type =
+ g_enum_register_static ("GstRTSPSrcTimeoutCause", timeout_causes);
+ }
+ return timeout_cause_type;
+}
+
enum _GstRtspSrcBufferMode
{
BUFFER_MODE_NONE,
@@ -1225,6 +1242,7 @@ gst_rtspsrc_class_init (GstRTSPSrcClass * klass)
gst_rtsp_ext_list_init ();
+ gst_type_mark_as_plugin_api (GST_TYPE_RTSP_SRC_TIMEOUT_CAUSE, 0);
gst_type_mark_as_plugin_api (GST_TYPE_RTSP_SRC_BUFFER_MODE, 0);
gst_type_mark_as_plugin_api (GST_TYPE_RTSP_SRC_NTP_TIME_SOURCE, 0);
gst_type_mark_as_plugin_api (GST_TYPE_RTSP_BACKCHANNEL, 0);
@@ -3584,8 +3602,8 @@ on_timeout (GObject * session, GObject * source, GstRTSPStream * stream)
/* timeout, post element message */
gst_element_post_message (GST_ELEMENT_CAST (src),
gst_message_new_element (GST_OBJECT_CAST (src),
- gst_structure_new ("GstRTSPSrcTimeout",
- "cause", G_TYPE_ENUM, GST_RTSP_SRC_TIMEOUT_CAUSE_RTCP,
+ gst_structure_new ("GstRTSPSrcTimeout", "cause",
+ GST_TYPE_RTSP_SRC_TIMEOUT_CAUSE, GST_RTSP_SRC_TIMEOUT_CAUSE_RTCP,
"stream-number", G_TYPE_INT, stream->id, "ssrc", G_TYPE_UINT,
stream->ssrc, NULL)));