static GstFlowReturn gst_avi_mux_collect_pads (GstCollectPads2 * pads,
GstAviMux * avimux);
-static gboolean gst_avi_mux_handle_event (GstPad * pad, GstEvent * event);
+static gboolean gst_avi_mux_handle_event (GstCollectPads2 * pad,
+ GstCollectData2 * data, GstEvent * event, gpointer user_data);
static GstPad *gst_avi_mux_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
static void gst_avi_mux_release_pad (GstElement * element, GstPad * pad);
gst_collect_pads2_set_function (avimux->collect,
(GstCollectPads2Function) (GST_DEBUG_FUNCPTR (gst_avi_mux_collect_pads)),
avimux);
+ gst_collect_pads2_set_event_function (avimux->collect,
+ (GstCollectPads2EventFunction) (GST_DEBUG_FUNCPTR
+ (gst_avi_mux_handle_event)), avimux);
/* set to clean state */
gst_avi_mux_reset (avimux);
avipad->collect = gst_collect_pads2_add_pad (avimux->collect,
newpad, sizeof (GstAviCollectData));
((GstAviCollectData *) (avipad->collect))->avipad = avipad;
- /* FIXME: hacked way to override/extend the event function of
- * GstCollectPads2; because it sets its own event function giving the
- * element no access to events */
- avimux->collect_event = (GstPadEventFunction) GST_PAD_EVENTFUNC (newpad);
- gst_pad_set_event_function (newpad,
- GST_DEBUG_FUNCPTR (gst_avi_mux_handle_event));
-
if (!gst_element_add_pad (element, newpad))
goto pad_add_failed;
/* handle events (search) */
static gboolean
-gst_avi_mux_handle_event (GstPad * pad, GstEvent * event)
+gst_avi_mux_handle_event (GstCollectPads2 * pads, GstCollectData2 * data,
+ GstEvent * event, gpointer user_data)
{
GstAviMux *avimux;
- gboolean ret;
- avimux = GST_AVI_MUX (gst_pad_get_parent (pad));
+ avimux = GST_AVI_MUX (user_data);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_TAG:{
}
/* now GstCollectPads2 can take care of the rest, e.g. EOS */
- ret = avimux->collect_event (pad, event);
-
- gst_object_unref (avimux);
-
- return ret;
+ return FALSE;
}
/* send extra 'padding' data */