Commit a00e9178 authored by Thibault Saunier's avatar Thibault Saunier 🌵 Committed by Mathieu Duponchelle

testbin: Forward seek to all sources

parent 68ae46ae
......@@ -195,6 +195,40 @@ gst_test_src_bin_set_element_property (GQuark property_id, const GValue * value,
return TRUE;
}
typedef struct
{
GstEvent *event;
gboolean res;
GstObject *parent;
} ForwardEventData;
static gboolean
forward_seeks (GstElement * element, GstPad * pad, ForwardEventData * data)
{
data->res &=
gst_pad_event_default (pad, data->parent, gst_event_ref (data->event));
return TRUE;
}
static gboolean
gst_test_src_event_function (GstPad * pad, GstObject * parent, GstEvent * event)
{
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:{
ForwardEventData data = { event, TRUE, parent };
gst_element_foreach_src_pad (GST_ELEMENT (parent),
(GstElementForeachPadFunc) forward_seeks, &data);
return data.res;
}
default:
break;
}
return gst_pad_event_default (pad, parent, event);
}
static void
gst_test_src_bin_setup_src (GstTestSrcBin * self, const gchar * srcfactory,
GstStaticPadTemplate * template, GstStreamType stype,
......@@ -231,6 +265,8 @@ gst_test_src_bin_setup_src (GstTestSrcBin * self, const gchar * srcfactory,
gst_flow_combiner_add_pad (self->flow_combiner, ghost);
gst_pad_set_chain_function (proxypad,
(GstPadChainFunction) gst_test_src_bin_chain);
gst_pad_set_event_function (ghost,
(GstPadEventFunction) gst_test_src_event_function);
gst_object_unref (proxypad);
gst_element_add_pad (GST_ELEMENT (self), ghost);
gst_object_unref (pad);
......
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