X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Felements%2Fgstvalve.c;h=9dbc7a6f68f45b5fc446094c7311d447ac246ec6;hb=a87b4551a6090663a1714f263d4e20fe75eb46ca;hp=97e2a49c73bc77c4e2b036f0d8a6b911944ae2f6;hpb=058533ff9f703c0119a3c5c8f35e710c080cab44;p=platform%2Fupstream%2Fgstreamer.git diff --git a/plugins/elements/gstvalve.c b/plugins/elements/gstvalve.c index 97e2a49..9dbc7a6 100644 --- a/plugins/elements/gstvalve.c +++ b/plugins/elements/gstvalve.c @@ -22,18 +22,14 @@ /** * SECTION:element-valve + * @title: valve * * The valve is a simple element that drops buffers when the #GstValve:drop * property is set to %TRUE and lets then through otherwise. * - * Any downstream error received while the #GstValve:drop property is %FALSE + * Any downstream error received while the #GstValve:drop property is %TRUE * is ignored. So downstream element can be set to %GST_STATE_NULL and removed, * without using pad blocking. - * - * This element was previously part of gst-plugins-farsight, and then - * gst-plugins-bad. - * - * Documentation last reviewed on 2010-12-30 (0.10.31) */ #ifdef HAVE_CONFIG_H @@ -72,7 +68,7 @@ static void gst_valve_get_property (GObject * object, static GstFlowReturn gst_valve_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer); -static gboolean gst_valve_event (GstPad * pad, GstObject * parent, +static gboolean gst_valve_sink_event (GstPad * pad, GstObject * parent, GstEvent * event); static gboolean gst_valve_query (GstPad * pad, GstObject * parent, GstQuery * query); @@ -97,12 +93,11 @@ gst_valve_class_init (GstValveClass * klass) g_object_class_install_property (gobject_class, PROP_DROP, g_param_spec_boolean ("drop", "Drop buffers and events", "Whether to drop buffers and events or let them through", - DEFAULT_DROP, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + DEFAULT_DROP, G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING | + G_PARAM_STATIC_STRINGS)); - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&srctemplate)); - gst_element_class_add_pad_template (gstelement_class, - gst_static_pad_template_get (&sinktemplate)); + gst_element_class_add_static_pad_template (gstelement_class, &srctemplate); + gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate); gst_element_class_set_static_metadata (gstelement_class, "Valve element", "Filter", "Drops buffers and events or lets them through", @@ -116,8 +111,6 @@ gst_valve_init (GstValve * valve) valve->discont = FALSE; valve->srcpad = gst_pad_new_from_static_template (&srctemplate, "src"); - gst_pad_set_event_function (valve->srcpad, - GST_DEBUG_FUNCPTR (gst_valve_event)); gst_pad_set_query_function (valve->srcpad, GST_DEBUG_FUNCPTR (gst_valve_query)); GST_PAD_SET_PROXY_CAPS (valve->srcpad); @@ -127,7 +120,7 @@ gst_valve_init (GstValve * valve) gst_pad_set_chain_function (valve->sinkpad, GST_DEBUG_FUNCPTR (gst_valve_chain)); gst_pad_set_event_function (valve->sinkpad, - GST_DEBUG_FUNCPTR (gst_valve_event)); + GST_DEBUG_FUNCPTR (gst_valve_sink_event)); gst_pad_set_query_function (valve->sinkpad, GST_DEBUG_FUNCPTR (gst_valve_query)); GST_PAD_SET_PROXY_CAPS (valve->sinkpad); @@ -222,7 +215,7 @@ gst_valve_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) static gboolean -gst_valve_event (GstPad * pad, GstObject * parent, GstEvent * event) +gst_valve_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) { GstValve *valve; gboolean is_sticky = GST_EVENT_IS_STICKY (event); @@ -257,7 +250,7 @@ gst_valve_query (GstPad * pad, GstObject * parent, GstQuery * query) { GstValve *valve = GST_VALVE (parent); - if (g_atomic_int_get (&valve->drop)) + if (GST_QUERY_IS_SERIALIZED (query) && g_atomic_int_get (&valve->drop)) return FALSE; return gst_pad_query_default (pad, parent, query);