summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/gstreamer/common/qgst_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/multimedia/gstreamer/common/qgst_p.h')
-rw-r--r--src/plugins/multimedia/gstreamer/common/qgst_p.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/multimedia/gstreamer/common/qgst_p.h b/src/plugins/multimedia/gstreamer/common/qgst_p.h
index 40897ad9d..ec2f9cb58 100644
--- a/src/plugins/multimedia/gstreamer/common/qgst_p.h
+++ b/src/plugins/multimedia/gstreamer/common/qgst_p.h
@@ -290,6 +290,8 @@ public:
gst_object_unref(m_object);
}
+ explicit operator bool() const { return bool(m_object); }
+
friend bool operator==(const QGstObject &a, const QGstObject &b)
{ return a.m_object == b.m_object; }
friend bool operator!=(const QGstObject &a, const QGstObject &b)
@@ -430,6 +432,10 @@ public:
QGstElement(const char *factory, const char *name = nullptr)
: QGstElement(gst_element_factory_make(factory, name), NeedsRef)
{
+#ifndef QT_NO_DEBUG
+ if (!m_object)
+ qWarning() << "Failed to make element" << name << "from factory" << factory;
+#endif
}
bool linkFiltered(const QGstElement &next, const QGstMutableCaps &caps)
@@ -595,6 +601,11 @@ inline QGstCaps QGValue::toCaps() const
return QGstCaps(gst_value_get_caps(value));
}
+inline QString errorMessageCannotFindElement(std::string_view element)
+{
+ return QStringLiteral("Could not find the %1 GStreamer element").arg(element.data());
+}
+
QT_END_NAMESPACE
#endif