matroskamux: Update for the new collectpads2 event handling API

This commit is contained in:
Sebastian Dröge 2012-01-26 10:37:52 +01:00
parent 76a22a6ebb
commit a54c4d6bc4

View file

@ -735,6 +735,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
GstMatroskaMux *mux; GstMatroskaMux *mux;
GstPad *pad; GstPad *pad;
GstTagList *list; GstTagList *list;
gboolean ret = FALSE;
mux = GST_MATROSKA_MUX (user_data); mux = GST_MATROSKA_MUX (user_data);
collect_pad = (GstMatroskaPad *) data; collect_pad = (GstMatroskaPad *) data;
@ -749,7 +750,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
collect_pad = (GstMatroskaPad *) gst_pad_get_element_private (pad); collect_pad = (GstMatroskaPad *) gst_pad_get_element_private (pad);
gst_event_parse_caps (event, &caps); gst_event_parse_caps (event, &caps);
collect_pad->capsfunc (pad, caps); ret = collect_pad->capsfunc (pad, caps);
gst_event_unref (event); gst_event_unref (event);
event = NULL; event = NULL;
break; break;
@ -781,6 +782,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
gst_event_unref (event); gst_event_unref (event);
/* handled this, don't want collectpads to forward it downstream */ /* handled this, don't want collectpads to forward it downstream */
event = NULL; event = NULL;
ret = TRUE;
break; break;
} }
case GST_EVENT_SEGMENT:{ case GST_EVENT_SEGMENT:{
@ -788,9 +790,11 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
if (segment->format != GST_FORMAT_TIME) { if (segment->format != GST_FORMAT_TIME) {
ret = FALSE;
}
gst_event_unref (event); gst_event_unref (event);
event = NULL; event = NULL;
} ret = TRUE;
break; break;
} }
case GST_EVENT_CUSTOM_DOWNSTREAM:{ case GST_EVENT_CUSTOM_DOWNSTREAM:{
@ -827,14 +831,18 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
/* transform into private data for stream; text form */ /* transform into private data for stream; text form */
gst_matroska_mux_build_vobsub_private (context, clut); gst_matroska_mux_build_vobsub_private (context, clut);
} }
break;
} }
/* fall through */
default: default:
ret = gst_pad_event_default (data->pad, GST_OBJECT (mux), event);
break;
case GST_EVENT_EOS:
gst_event_unref (event);
ret = TRUE;
break; break;
} }
/* now GstCollectPads2 can take care of the rest, e.g. EOS */ return ret;
return (event == NULL);
} }
static void static void