mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
funnel: Some random cleanup
This commit is contained in:
parent
9c9f619f6b
commit
acb8203e62
1 changed files with 15 additions and 18 deletions
|
@ -109,17 +109,17 @@ GST_BOILERPLATE_FULL (GstFunnel, gst_funnel, GstElement, GST_TYPE_ELEMENT,
|
||||||
|
|
||||||
static GstStateChangeReturn gst_funnel_change_state (GstElement * element,
|
static GstStateChangeReturn gst_funnel_change_state (GstElement * element,
|
||||||
GstStateChange transition);
|
GstStateChange transition);
|
||||||
|
|
||||||
static GstPad *gst_funnel_request_new_pad (GstElement * element,
|
static GstPad *gst_funnel_request_new_pad (GstElement * element,
|
||||||
GstPadTemplate * templ, const gchar * name);
|
GstPadTemplate * templ, const gchar * name);
|
||||||
static void gst_funnel_release_pad (GstElement * element, GstPad * pad);
|
static void gst_funnel_release_pad (GstElement * element, GstPad * pad);
|
||||||
|
|
||||||
static GstFlowReturn gst_funnel_buffer_alloc (GstPad * pad, guint64 offset,
|
static GstFlowReturn gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer);
|
||||||
|
static GstFlowReturn gst_funnel_sink_buffer_alloc (GstPad * pad, guint64 offset,
|
||||||
guint size, GstCaps * caps, GstBuffer ** buf);
|
guint size, GstCaps * caps, GstBuffer ** buf);
|
||||||
static GstFlowReturn gst_funnel_chain (GstPad * pad, GstBuffer * buffer);
|
static gboolean gst_funnel_sink_event (GstPad * pad, GstEvent * event);
|
||||||
static gboolean gst_funnel_event (GstPad * pad, GstEvent * event);
|
static GstCaps *gst_funnel_sink_getcaps (GstPad * pad);
|
||||||
|
|
||||||
static gboolean gst_funnel_src_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_funnel_src_event (GstPad * pad, GstEvent * event);
|
||||||
static GstCaps *gst_funnel_getcaps (GstPad * pad);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_funnel_base_init (gpointer g_class)
|
gst_funnel_base_init (gpointer g_class)
|
||||||
|
@ -136,7 +136,6 @@ gst_funnel_base_init (gpointer g_class)
|
||||||
gst_static_pad_template_get (&funnel_src_template));
|
gst_static_pad_template_get (&funnel_src_template));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_funnel_dispose (GObject * object)
|
gst_funnel_dispose (GObject * object)
|
||||||
{
|
{
|
||||||
|
@ -180,7 +179,7 @@ gst_funnel_init (GstFunnel * funnel, GstFunnelClass * g_class)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_funnel_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
gst_funnel_sink_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
||||||
GstCaps * caps, GstBuffer ** buf)
|
GstCaps * caps, GstBuffer ** buf)
|
||||||
{
|
{
|
||||||
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent_element (pad));
|
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent_element (pad));
|
||||||
|
@ -193,7 +192,6 @@ gst_funnel_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static GstPad *
|
static GstPad *
|
||||||
gst_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
gst_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
||||||
const gchar * name)
|
const gchar * name)
|
||||||
|
@ -206,12 +204,14 @@ gst_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
||||||
"name", name, "direction", templ->direction, "template", templ,
|
"name", name, "direction", templ->direction, "template", templ,
|
||||||
NULL));
|
NULL));
|
||||||
|
|
||||||
gst_pad_set_chain_function (sinkpad, GST_DEBUG_FUNCPTR (gst_funnel_chain));
|
gst_pad_set_chain_function (sinkpad,
|
||||||
gst_pad_set_event_function (sinkpad, GST_DEBUG_FUNCPTR (gst_funnel_event));
|
GST_DEBUG_FUNCPTR (gst_funnel_sink_chain));
|
||||||
|
gst_pad_set_event_function (sinkpad,
|
||||||
|
GST_DEBUG_FUNCPTR (gst_funnel_sink_event));
|
||||||
gst_pad_set_getcaps_function (sinkpad,
|
gst_pad_set_getcaps_function (sinkpad,
|
||||||
GST_DEBUG_FUNCPTR (gst_funnel_getcaps));
|
GST_DEBUG_FUNCPTR (gst_funnel_sink_getcaps));
|
||||||
gst_pad_set_bufferalloc_function (sinkpad,
|
gst_pad_set_bufferalloc_function (sinkpad,
|
||||||
GST_DEBUG_FUNCPTR (gst_funnel_buffer_alloc));
|
GST_DEBUG_FUNCPTR (gst_funnel_sink_buffer_alloc));
|
||||||
|
|
||||||
gst_pad_set_active (sinkpad, TRUE);
|
gst_pad_set_active (sinkpad, TRUE);
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ gst_funnel_release_pad (GstElement * element, GstPad * pad)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_funnel_getcaps (GstPad * pad)
|
gst_funnel_sink_getcaps (GstPad * pad)
|
||||||
{
|
{
|
||||||
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
|
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -248,7 +248,7 @@ gst_funnel_getcaps (GstPad * pad)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_funnel_chain (GstPad * pad, GstBuffer * buffer)
|
gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
|
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
|
||||||
|
@ -290,7 +290,6 @@ gst_funnel_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
GST_WARNING_OBJECT (funnel, "Could not push out newsegment event");
|
GST_WARNING_OBJECT (funnel, "Could not push out newsegment event");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GST_OBJECT_LOCK (pad);
|
GST_OBJECT_LOCK (pad);
|
||||||
padcaps = GST_PAD_CAPS (funnel->srcpad);
|
padcaps = GST_PAD_CAPS (funnel->srcpad);
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
@ -313,7 +312,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_funnel_event (GstPad * pad, GstEvent * event)
|
gst_funnel_sink_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
|
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
|
||||||
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
|
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
|
||||||
|
@ -333,7 +332,6 @@ gst_funnel_event (GstPad * pad, GstEvent * event)
|
||||||
gst_event_parse_new_segment_full (event, &update, &rate, &arate,
|
gst_event_parse_new_segment_full (event, &update, &rate, &arate,
|
||||||
&format, &start, &stop, &time);
|
&format, &start, &stop, &time);
|
||||||
|
|
||||||
|
|
||||||
GST_OBJECT_LOCK (funnel);
|
GST_OBJECT_LOCK (funnel);
|
||||||
gst_segment_set_newsegment_full (&fpad->segment, update, rate, arate,
|
gst_segment_set_newsegment_full (&fpad->segment, update, rate, arate,
|
||||||
format, start, stop, time);
|
format, start, stop, time);
|
||||||
|
@ -354,7 +352,6 @@ gst_funnel_event (GstPad * pad, GstEvent * event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (forward)
|
if (forward)
|
||||||
res = gst_pad_push_event (funnel->srcpad, event);
|
res = gst_pad_push_event (funnel->srcpad, event);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue