rtspsrc: Properly notify missing elements

If the srtp elements are not present, post a message on the bus
informing about the missing plugins.
This commit is contained in:
Edward Hervey 2017-02-13 11:17:25 +01:00 committed by Edward Hervey
parent b6723ecd3c
commit 49002fa8a7

View file

@ -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) {