qsv: use new plugin status message API
authorTim-Philipp Müller <tim@centricular.com>
Sat, 28 Jan 2023 02:15:24 +0000 (02:15 +0000)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 21 Feb 2024 00:58:19 +0000 (00:58 +0000)
Minimal example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3832>

subprojects/gst-plugins-bad/sys/qsv/plugin.cpp

index 15887f888fbbede1e82ad8a5238fac2bb6cacdc0..a6fdddd40dbe29d9dfa636271dca1b2135cf5ae8 100644 (file)
@@ -61,6 +61,8 @@
 #include <gst/va/gstva.h>
 #endif
 
+#include <glib/gi18n-lib.h>
+
 GST_DEBUG_CATEGORY (gst_qsv_debug);
 GST_DEBUG_CATEGORY (gst_qsv_allocator_debug);
 
@@ -214,8 +216,11 @@ plugin_init (GstPlugin * plugin)
 #ifdef G_OS_WIN32
   /* D3D11 Video API is supported since Windows 8.
    * Do we want to support old OS (Windows 7 for example) with D3D9 ?? */
-  if (!IsWindows8OrGreater ())
+  if (!IsWindows8OrGreater ()) {
+    gst_plugin_add_status_warning (plugin,
+        N_("This plugin requires at least Windows 8 or newer."));
     return TRUE;
+  }
 
   enc_rank = GST_RANK_PRIMARY;
 #endif
@@ -225,11 +230,15 @@ plugin_init (GstPlugin * plugin)
       "qsvallocator", 0, "qsvallocator");
 
   loader = gst_qsv_get_loader ();
-  if (!loader)
+  if (!loader) {
+    // FIXME: any status/error/warning message we should show here?
     return TRUE;
+  }
 
   platform_devices = gst_qsv_get_platform_devices ();
   if (!platform_devices) {
+    gst_plugin_add_status_warning (plugin,
+        N_("No Intel graphics cards detected!"));
     gst_qsv_deinit ();
     return TRUE;
   }