From 9b981dd2445f1793dad0e704d431e15590736ade Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 12 Apr 2013 13:44:52 +0200 Subject: [PATCH] plugins: fix description for gst-inspect. Fix the name of the plug-in element reported to gst-inspect-1.0. i.e. we need an explicit definition for GStreamer >= 1.0 because the GST_PLUGIN_DEFINE incorrectly uses #name for creating the plug-in name, instead of using macro expansion (and let further expansion of macros) through e.g. G_STRINGIFY(). --- gst-libs/gst/vaapi/gstcompat.h | 6 ------ gst/vaapi/gstvaapi.c | 24 +++++++++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gst-libs/gst/vaapi/gstcompat.h b/gst-libs/gst/vaapi/gstcompat.h index aedd93b219..16b3c71f58 100644 --- a/gst-libs/gst/vaapi/gstcompat.h +++ b/gst-libs/gst/vaapi/gstcompat.h @@ -64,9 +64,6 @@ typedef void (*GstCompatTypeFindSuggestFunction)(gpointer, guint, GstCaps *); #define GST_PAD_QUERY_FUNCTION_CALL(func, pad, parent, query) \ (func)(pad, parent, query) -/* GstPlugin */ -#define GST_PLUGIN_DESC_NAME(NAME) NAME - /* Misc helpers */ #define GST_MAKE_FORMAT_STRING(FORMAT) \ "format=(string)" G_STRINGIFY(FORMAT) @@ -262,9 +259,6 @@ typedef void (*GstCompatTypeFindSuggestFunction)(gpointer, guint, const GstCaps #define GST_PAD_QUERY_FUNCTION_CALL(func, pad, parent, query) \ (func)(pad, query) -/* GstPlugin */ -#define GST_PLUGIN_DESC_NAME(NAME) G_STRINGIFY(NAME) - /* Misc helpers */ #define GST_MAKE_FORMAT_STRING(FORMAT) \ "format=(fourcc)" G_STRINGIFY(FORMAT) diff --git a/gst/vaapi/gstvaapi.c b/gst/vaapi/gstvaapi.c index 407989d45f..600632d60f 100644 --- a/gst/vaapi/gstvaapi.c +++ b/gst/vaapi/gstvaapi.c @@ -29,6 +29,10 @@ #include "gstvaapipostproc.h" #include "gstvaapisink.h" +#define PLUGIN_NAME "vaapi" +#define PLUGIN_DESC "VA-API based elements" +#define PLUGIN_LICENSE "LGPL" + static gboolean plugin_init (GstPlugin *plugin) { @@ -54,12 +58,14 @@ plugin_init (GstPlugin *plugin) return TRUE; } -GST_PLUGIN_DEFINE( - GST_VERSION_MAJOR, GST_VERSION_MINOR, - GST_PLUGIN_DESC_NAME(vaapi), - "VA-API based elements", - plugin_init, - PACKAGE_VERSION, - "LGPL", - PACKAGE, - PACKAGE_BUGREPORT) +#if GST_CHECK_VERSION(1,0,0) +/* XXX: use PLUGIN_NAME when GST_PLUGIN_DEFINE is fixed to use + G_STRINGIFY() for name argument, instead of plain #name */ +GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR, + vaapi, PLUGIN_DESC, plugin_init, + PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT) +#else +GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR, + PLUGIN_NAME, PLUGIN_DESC, plugin_init, + PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT) +#endif