From 713da78201a789b9613c7123560f29542f1b6c3d Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 29 Aug 2013 14:26:05 -0300 Subject: [PATCH] pad-monitor: avoid tracking tag events Tag events are hard to track and check if properly serialized because they mutate too much inside elements. There is no reliable way currently to match a tag event pushed into an element and another tag event leaving the element (other than if the pointers are actually the same). --- .../gst/validate/gst-validate-pad-monitor.c | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 180475787f..a3a4344e8f 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -1342,6 +1342,27 @@ gst_validate_pad_monitor_chain_func (GstPad * pad, GstObject * parent, return ret; } +static gboolean +gst_validate_pad_monitor_event_is_tracked (GstValidatePadMonitor * monitor, + GstEvent * event) +{ + if (!GST_EVENT_IS_SERIALIZED (event)) { + return FALSE; + } + + /* we don't track Tag events because they mutate too much and it is hard + * to match a tag event pushed on a source pad with the one that was received + * on a sink pad. + * One idea would be to use seqnum, but it seems that it is undefined whether + * seqnums should be maintained in tag events that are created from others + * up to today. (2013-08-29) + */ + if (GST_EVENT_TYPE (event) == GST_EVENT_TAG) + return FALSE; + + return TRUE; +} + static gboolean gst_validate_pad_monitor_sink_event_func (GstPad * pad, GstObject * parent, GstEvent * event) @@ -1353,7 +1374,7 @@ gst_validate_pad_monitor_sink_event_func (GstPad * pad, GstObject * parent, GST_VALIDATE_PAD_MONITOR_PARENT_LOCK (pad_monitor); GST_VALIDATE_MONITOR_LOCK (pad_monitor); - if (GST_EVENT_IS_SERIALIZED (event)) { + if (gst_validate_pad_monitor_event_is_tracked (pad_monitor, event)) { GstClockTime last_ts; if (GST_CLOCK_TIME_IS_VALID (pad_monitor->current_timestamp)) { last_ts = pad_monitor->current_timestamp;