pad-monitor: mark the peer pad as EOS too.

When a sink pad gets EOS, its src pad monitor should also
be marked as EOS (helpful with issue concatenation).
This commit is contained in:
Mathieu Duponchelle 2014-10-12 16:13:51 +02:00 committed by Mathieu Duponchelle
parent 0b1d00df25
commit 5690a02e0a

View file

@ -121,18 +121,13 @@ typedef struct
GstEvent *event;
} SerializedEventData;
static gboolean
_find_master_report_on_pad (GstPad * pad, GstValidateReport * report)
static GstPad *
_get_actual_pad (GstPad *pad)
{
GstValidatePadMonitor *pad_monitor;
GstValidateReport *prev_report;
GstPad *tmp_pad;
gboolean result = FALSE;
gst_object_ref (pad);
/* We don't monitor ghost pads */
while (GST_IS_GHOST_PAD (pad)) {
tmp_pad = pad;
@ -146,6 +141,18 @@ _find_master_report_on_pad (GstPad * pad, GstValidateReport * report)
gst_object_unref (tmp_pad);
}
return pad;
}
static gboolean
_find_master_report_on_pad (GstPad * pad, GstValidateReport * report)
{
GstValidatePadMonitor *pad_monitor;
GstValidateReport *prev_report;
gboolean result = FALSE;
pad = _get_actual_pad (pad);
pad_monitor = g_object_get_data ((GObject *) pad, "validate-monitor");
/* For some reason this pad isn't monitored */
@ -1446,6 +1453,24 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
}
}
static void
mark_pads_eos (GstValidatePadMonitor *pad_monitor)
{
GstValidatePadMonitor *peer_monitor;
GstPad *peer = gst_pad_get_peer (pad_monitor->pad);
GstPad *real_peer;
pad_monitor->is_eos = TRUE;
if (peer) {
real_peer = _get_actual_pad (peer);
peer_monitor = g_object_get_data ((GObject *) real_peer, "validate-monitor");
if (peer_monitor)
peer_monitor->is_eos = TRUE;
gst_object_unref (peer);
gst_object_unref (real_peer);
}
}
static gboolean
gst_validate_pad_monitor_downstream_event_check (GstValidatePadMonitor *
pad_monitor, GstObject * parent, GstEvent * event,
@ -1687,7 +1712,7 @@ gst_validate_pad_monitor_chain_func (GstPad * pad, GstObject * parent,
pad_monitor->last_flow_return = ret;
if (ret == GST_FLOW_EOS) {
pad_monitor->is_eos = ret;
mark_pads_eos (pad_monitor);
}
if (PAD_PARENT_IS_DEMUXER (pad_monitor))
gst_validate_pad_monitor_check_aggregated_return (pad_monitor, ret);