dtlsdec: Fix critical warning "got data flow before stream-start event"
Forward sticky events on requested src pad. https://bugzilla.gnome.org/show_bug.cgi?id=750348
This commit is contained in:
parent
a85a8afc3e
commit
f530aac115
@ -187,7 +187,6 @@ gst_dtls_dec_class_init (GstDtlsDecClass * klass)
|
|||||||
static void
|
static void
|
||||||
gst_dtls_dec_init (GstDtlsDec * self)
|
gst_dtls_dec_init (GstDtlsDec * self)
|
||||||
{
|
{
|
||||||
GstPad *sink;
|
|
||||||
self->agent = get_agent_by_pem (NULL);
|
self->agent = get_agent_by_pem (NULL);
|
||||||
self->connection_id = NULL;
|
self->connection_id = NULL;
|
||||||
self->connection = NULL;
|
self->connection = NULL;
|
||||||
@ -200,13 +199,14 @@ gst_dtls_dec_init (GstDtlsDec * self)
|
|||||||
g_mutex_init (&self->src_mutex);
|
g_mutex_init (&self->src_mutex);
|
||||||
|
|
||||||
self->src = NULL;
|
self->src = NULL;
|
||||||
sink = gst_pad_new_from_static_template (&sink_template, "sink");
|
self->sink = gst_pad_new_from_static_template (&sink_template, "sink");
|
||||||
g_return_if_fail (sink);
|
g_return_if_fail (self->sink);
|
||||||
|
|
||||||
gst_pad_set_chain_function (sink, GST_DEBUG_FUNCPTR (sink_chain));
|
gst_pad_set_chain_function (self->sink, GST_DEBUG_FUNCPTR (sink_chain));
|
||||||
gst_pad_set_chain_list_function (sink, GST_DEBUG_FUNCPTR (sink_chain_list));
|
gst_pad_set_chain_list_function (self->sink,
|
||||||
|
GST_DEBUG_FUNCPTR (sink_chain_list));
|
||||||
|
|
||||||
gst_element_add_pad (GST_ELEMENT (self), sink);
|
gst_element_add_pad (GST_ELEMENT (self), self->sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -337,6 +337,21 @@ gst_dtls_dec_change_state (GstElement * element, GstStateChange transition)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
forward_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
|
||||||
|
{
|
||||||
|
GstPad *srcpad = GST_PAD_CAST (user_data);
|
||||||
|
GstFlowReturn ret;
|
||||||
|
|
||||||
|
ret = gst_pad_store_sticky_event (srcpad, *event);
|
||||||
|
if (ret != GST_FLOW_OK) {
|
||||||
|
GST_DEBUG_OBJECT (srcpad, "storing sticky event %p (%s) failed: %s", *event,
|
||||||
|
GST_EVENT_TYPE_NAME (*event), gst_flow_get_name (ret));
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static GstPad *
|
static GstPad *
|
||||||
gst_dtls_dec_request_new_pad (GstElement * element,
|
gst_dtls_dec_request_new_pad (GstElement * element,
|
||||||
GstPadTemplate * tmpl, const gchar * name, const GstCaps * caps)
|
GstPadTemplate * tmpl, const gchar * name, const GstCaps * caps)
|
||||||
@ -366,6 +381,9 @@ gst_dtls_dec_request_new_pad (GstElement * element,
|
|||||||
if (caps)
|
if (caps)
|
||||||
gst_pad_set_caps (pad, (GstCaps *) caps);
|
gst_pad_set_caps (pad, (GstCaps *) caps);
|
||||||
|
|
||||||
|
/* Forward sticky events to the new srcpad */
|
||||||
|
gst_pad_sticky_events_foreach (self->sink, forward_sticky_events, self->src);
|
||||||
|
|
||||||
gst_element_add_pad (element, pad);
|
gst_element_add_pad (element, pad);
|
||||||
|
|
||||||
return pad;
|
return pad;
|
||||||
|
@ -51,6 +51,7 @@ struct _GstDtlsDec {
|
|||||||
GstElement element;
|
GstElement element;
|
||||||
|
|
||||||
GstPad *src;
|
GstPad *src;
|
||||||
|
GstPad *sink;
|
||||||
GMutex src_mutex;
|
GMutex src_mutex;
|
||||||
|
|
||||||
GstDtlsAgent *agent;
|
GstDtlsAgent *agent;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user