mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
misc: chain up to collectpads event handler
This commit is contained in:
parent
531142c7e4
commit
04b4d30f2c
7 changed files with 35 additions and 55 deletions
|
@ -1835,7 +1835,7 @@ gst_avi_mux_handle_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
GstEvent * event, gpointer user_data)
|
||||
{
|
||||
GstAviMux *avimux;
|
||||
gboolean ret = FALSE;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
avimux = GST_AVI_MUX (user_data);
|
||||
|
||||
|
@ -1860,6 +1860,7 @@ gst_avi_mux_handle_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
ret = gst_avi_mux_audsink_set_caps (data->pad, caps);
|
||||
}
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_TAG:{
|
||||
|
@ -1870,19 +1871,16 @@ gst_avi_mux_handle_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
gst_event_parse_tag (event, &list);
|
||||
gst_tag_setter_merge_tags (setter, list, mode);
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_EOS:
|
||||
case GST_EVENT_SEGMENT:
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
break;
|
||||
default:
|
||||
ret = gst_pad_event_default (data->pad, GST_OBJECT (avimux), event);
|
||||
break;
|
||||
}
|
||||
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, data, event, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -287,7 +287,7 @@ gst_flv_mux_handle_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
GstEvent * event, gpointer user_data)
|
||||
{
|
||||
GstFlvMux *mux = GST_FLV_MUX (user_data);
|
||||
gboolean ret = FALSE;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_CAPS:
|
||||
|
@ -308,6 +308,7 @@ gst_flv_mux_handle_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
}
|
||||
/* and eat */
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_TAG:{
|
||||
|
@ -320,18 +321,16 @@ gst_flv_mux_handle_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
mux->new_tags = TRUE;
|
||||
ret = TRUE;
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_EOS:
|
||||
case GST_EVENT_SEGMENT:
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
break;
|
||||
default:
|
||||
ret = gst_pad_event_default (data->pad, GST_OBJECT (mux), event);
|
||||
break;
|
||||
}
|
||||
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, data, event, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -816,7 +816,7 @@ gst_interleave_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
GstEvent * event, gpointer user_data)
|
||||
{
|
||||
GstInterleave *self = GST_INTERLEAVE (user_data);
|
||||
gboolean ret = FALSE;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
GST_DEBUG ("Got %s event on pad %s:%s", GST_EVENT_TYPE_NAME (event),
|
||||
GST_DEBUG_PAD_NAME (data->pad));
|
||||
|
@ -838,14 +838,17 @@ gst_interleave_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
gst_event_parse_caps (event, &caps);
|
||||
ret = gst_interleave_sink_setcaps (self, data->pad, caps);
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ret = gst_pad_event_default (data->pad, GST_OBJECT (self), event);
|
||||
break;
|
||||
}
|
||||
|
||||
/* now GstCollectPads2 can take care of the rest, e.g. EOS */
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, data, event, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -3280,7 +3280,7 @@ gst_qt_mux_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
GstQTMux *qtmux;
|
||||
guint32 avg_bitrate = 0, max_bitrate = 0;
|
||||
GstPad *pad = data->pad;
|
||||
gboolean ret = FALSE;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
qtmux = GST_QT_MUX_CAST (user_data);
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
|
@ -3298,6 +3298,7 @@ gst_qt_mux_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
|
||||
ret = collect_pad->set_caps (pad, caps);
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_TAG:{
|
||||
|
@ -3327,19 +3328,17 @@ gst_qt_mux_sink_event (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
}
|
||||
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ret = gst_pad_event_default (data->pad, GST_OBJECT (qtmux), event);
|
||||
break;
|
||||
case GST_EVENT_EOS:
|
||||
case GST_EVENT_SEGMENT:
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, data, event, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -746,7 +746,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
|
|||
GstMatroskaMux *mux;
|
||||
GstPad *pad;
|
||||
GstTagList *list;
|
||||
gboolean ret = FALSE;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
mux = GST_MATROSKA_MUX (user_data);
|
||||
collect_pad = (GstMatroskaPad *) data;
|
||||
|
@ -796,18 +796,6 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
|
|||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_SEGMENT:{
|
||||
const GstSegment *segment;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
if (segment->format != GST_FORMAT_TIME) {
|
||||
ret = FALSE;
|
||||
}
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_TOC:{
|
||||
GstToc *toc;
|
||||
|
||||
|
@ -869,14 +857,12 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
|
|||
}
|
||||
/* fall through */
|
||||
default:
|
||||
ret = gst_pad_event_default (data->pad, GST_OBJECT (mux), event);
|
||||
break;
|
||||
case GST_EVENT_EOS:
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, data, event, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -333,10 +333,12 @@ gst_smpte_sink_event (GstCollectPads2 * pads,
|
|||
break;
|
||||
}
|
||||
default:
|
||||
ret = gst_pad_event_default (pad,
|
||||
GST_OBJECT_CAST (GST_PAD_PARENT (pad)), event);
|
||||
break;
|
||||
}
|
||||
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, data, event, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -1631,7 +1631,6 @@ gst_videomixer2_sink_event (GstCollectPads2 * pads, GstCollectData2 * cdata,
|
|||
GST_DEBUG_OBJECT (pad, "Got %s event on pad %s:%s",
|
||||
GST_EVENT_TYPE_NAME (event), GST_DEBUG_PAD_NAME (pad));
|
||||
|
||||
/* return FALSE => event will be forwarded */
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_CAPS:
|
||||
{
|
||||
|
@ -1642,6 +1641,7 @@ gst_videomixer2_sink_event (GstCollectPads2 * pads, GstCollectData2 * cdata,
|
|||
gst_videomixer2_pad_sink_setcaps (GST_PAD (pad), GST_OBJECT (mix),
|
||||
caps);
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_SEGMENT:{
|
||||
|
@ -1649,9 +1649,6 @@ gst_videomixer2_sink_event (GstCollectPads2 * pads, GstCollectData2 * cdata,
|
|||
gst_event_copy_segment (event, &seg);
|
||||
|
||||
g_assert (seg.format == GST_FORMAT_TIME);
|
||||
/* eat SEGMENT events */
|
||||
ret = TRUE;
|
||||
gst_event_unref (event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
|
@ -1666,18 +1663,14 @@ gst_videomixer2_sink_event (GstCollectPads2 * pads, GstCollectData2 * cdata,
|
|||
mix->segment.position = -1;
|
||||
mix->ts_offset = 0;
|
||||
mix->nframes = 0;
|
||||
|
||||
ret = gst_pad_event_default (cdata->pad, GST_OBJECT (mix), event);
|
||||
break;
|
||||
case GST_EVENT_EOS:
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
break;
|
||||
default:
|
||||
ret = gst_pad_event_default (cdata->pad, GST_OBJECT (mix), event);
|
||||
break;
|
||||
}
|
||||
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, cdata, event, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue