mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
pad-monitor: add another acceptable flow return combination scenarios
A demuxer knows when to return EOS after samples are over, so it is ok for it to return even when all src pads returned OK
This commit is contained in:
parent
a06a9038a4
commit
b591f11b15
3 changed files with 17 additions and 3 deletions
|
@ -132,6 +132,7 @@ gst_validate_element_monitor_inspect (GstValidateElementMonitor * monitor)
|
||||||
gst_element_class_get_metadata (klass, GST_ELEMENT_METADATA_KLASS);
|
gst_element_class_get_metadata (klass, GST_ELEMENT_METADATA_KLASS);
|
||||||
monitor->is_decoder = strstr (klassname, "Decoder") != NULL;
|
monitor->is_decoder = strstr (klassname, "Decoder") != NULL;
|
||||||
monitor->is_encoder = strstr (klassname, "Encoder") != NULL;
|
monitor->is_encoder = strstr (klassname, "Encoder") != NULL;
|
||||||
|
monitor->is_demuxer = strstr (klassname, "Demuxer") != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -41,6 +41,7 @@ G_BEGIN_DECLS
|
||||||
#define GST_VALIDATE_ELEMENT_MONITOR_GET_ELEMENT(m) (GST_ELEMENT_CAST (GST_VALIDATE_MONITOR_GET_OBJECT (m)))
|
#define GST_VALIDATE_ELEMENT_MONITOR_GET_ELEMENT(m) (GST_ELEMENT_CAST (GST_VALIDATE_MONITOR_GET_OBJECT (m)))
|
||||||
#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_DECODER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_decoder)
|
#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_DECODER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_decoder)
|
||||||
#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_ENCODER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_encoder)
|
#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_ENCODER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_encoder)
|
||||||
|
#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_DEMUXER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_demuxer)
|
||||||
|
|
||||||
typedef struct _GstValidateElementMonitor GstValidateElementMonitor;
|
typedef struct _GstValidateElementMonitor GstValidateElementMonitor;
|
||||||
typedef struct _GstValidateElementMonitorClass GstValidateElementMonitorClass;
|
typedef struct _GstValidateElementMonitorClass GstValidateElementMonitorClass;
|
||||||
|
@ -61,6 +62,7 @@ struct _GstValidateElementMonitor {
|
||||||
|
|
||||||
gboolean is_decoder;
|
gboolean is_decoder;
|
||||||
gboolean is_encoder;
|
gboolean is_encoder;
|
||||||
|
gboolean is_demuxer;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -833,10 +833,21 @@ gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor *
|
||||||
/* no peer pad found, nothing to do */
|
/* no peer pad found, nothing to do */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (monitor->is_eos && ret == GST_FLOW_EOS) {
|
if (aggregated == GST_FLOW_OK || aggregated == GST_FLOW_EOS) {
|
||||||
/* this is acceptable */
|
/* those are acceptable situations */
|
||||||
return;
|
|
||||||
|
if (monitor->is_eos && ret == GST_FLOW_EOS) {
|
||||||
|
/* this element received eos and returned eos */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_DEMUXER (monitor)
|
||||||
|
&& ret == GST_FLOW_EOS) {
|
||||||
|
/* a demuxer can return EOS when the samples end */
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aggregated != ret) {
|
if (aggregated != ret) {
|
||||||
GST_VALIDATE_REPORT (monitor, WRONG_FLOW_RETURN,
|
GST_VALIDATE_REPORT (monitor, WRONG_FLOW_RETURN,
|
||||||
"Wrong combined flow return %s(%d). Expected: %s(%d)",
|
"Wrong combined flow return %s(%d). Expected: %s(%d)",
|
||||||
|
|
Loading…
Reference in a new issue