validate-element-monitor: Detect basesink elements
authorEdward Hervey <edward@centricular.com>
Tue, 5 Jun 2018 15:53:51 +0000 (17:53 +0200)
committerThibault Saunier <tsaunier@igalia.com>
Thu, 30 Apr 2020 16:40:12 +0000 (12:40 -0400)
And add a macro

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/174>

validate/gst/validate/gst-validate-element-monitor.c
validate/gst/validate/gst-validate-element-monitor.h

index b8f9e6f..2966b14 100644 (file)
@@ -207,6 +207,8 @@ gst_validate_element_monitor_inspect (GstValidateElementMonitor * monitor)
   } else
     GST_ERROR_OBJECT (element, "no klassname");
 
+  monitor->is_sink = GST_IS_BASE_SINK (element);
+
   gst_object_unref (element);
 }
 
index 9a80d2a..92e90d9 100644 (file)
@@ -42,6 +42,7 @@ G_BEGIN_DECLS
 #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)
 #define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_CONVERTER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_converter)
+#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_SINK(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_sink)
 
 typedef struct _GstValidateElementMonitor GstValidateElementMonitor;
 typedef struct _GstValidateElementMonitorClass GstValidateElementMonitorClass;
@@ -64,6 +65,7 @@ struct _GstValidateElementMonitor {
   gboolean       is_encoder;
   gboolean       is_demuxer;
   gboolean       is_converter;
+  gboolean       is_sink;
 };
 
 /**