From 49002fa8a7b6d782788e846de194b4f4c765cea5 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 13 Feb 2017 11:17:25 +0100 Subject: [PATCH] rtspsrc: Properly notify missing elements If the srtp elements are not present, post a message on the bus informing about the missing plugins. --- gst/rtsp/gstrtspsrc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 35bd8c6cb8..17967b3283 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -2811,6 +2811,11 @@ request_rtp_decoder (GstElement * rtpbin, guint session, GstRTSPStream * stream) stream->srtpdec = gst_element_factory_make ("srtpdec", name); g_free (name); + if (stream->srtpdec == NULL) { + GST_ELEMENT_ERROR (stream->parent, CORE, MISSING_PLUGIN, (NULL), + ("no srtpdec element present!")); + return NULL; + } g_signal_connect (stream->srtpdec, "request-key", (GCallback) request_key, stream); } @@ -2839,6 +2844,12 @@ request_rtcp_encoder (GstElement * rtpbin, guint session, stream->srtpenc = gst_element_factory_make ("srtpenc", name); g_free (name); + if (stream->srtpenc == NULL) { + GST_ELEMENT_ERROR (stream->parent, CORE, MISSING_PLUGIN, (NULL), + ("no srtpenc element present!")); + return NULL; + } + /* get RTCP crypto parameters from caps */ s = gst_caps_get_structure (stream->srtcpparams, 0); if (s) {