Commit bbf226d9 authored by Thiago Santos's avatar Thiago Santos

appsrc: add send_event handler for flushing

Adds a send_event handling for allowing appsrc to flush its internal
data, allowing users to flush the pipeline without setting it to null.

https://bugzilla.gnome.org/show_bug.cgi?id=724231
parent 32029383
......@@ -214,6 +214,8 @@ static void gst_app_src_set_property (GObject * object, guint prop_id,
static void gst_app_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static gboolean gst_app_src_send_event (GstElement * element, GstEvent * event);
static void gst_app_src_set_latencies (GstAppSrc * appsrc,
gboolean do_min, guint64 min, gboolean do_max, guint64 max);
......@@ -479,6 +481,8 @@ gst_app_src_class_init (GstAppSrcClass * klass)
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_app_src_template));
element_class->send_event = gst_app_src_send_event;
basesrc_class->negotiate = gst_app_src_negotiate;
basesrc_class->get_caps = gst_app_src_internal_get_caps;
basesrc_class->create = gst_app_src_create;
......@@ -700,6 +704,23 @@ gst_app_src_get_property (GObject * object, guint prop_id, GValue * value,
}
}
static gboolean
gst_app_src_send_event (GstElement * element, GstEvent * event)
{
GstAppSrc *appsrc = GST_APP_SRC_CAST (element);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_STOP:
gst_app_src_flush_queued (appsrc);
break;
default:
break;
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, send_event, (element,
event), FALSE);
}
static gboolean
gst_app_src_unlock (GstBaseSrc * bsrc)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment