plugins: use modern GstElement metadata information.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 20 Mar 2013 17:41:40 +0000 (18:41 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 20 Mar 2013 17:43:35 +0000 (18:43 +0100)
Use gst_element_class_set_static_metadata() from GStreamer 1.0, which
basically is the same as gst_element_class_set_details_simple() in
GStreamer 0.10 context.

gst-libs/gst/vaapi/gstcompat.h
gst/vaapi/gstvaapidecode.c
gst/vaapi/gstvaapidownload.c
gst/vaapi/gstvaapipostproc.c
gst/vaapi/gstvaapisink.c
gst/vaapi/gstvaapiupload.c

index 8ff3180..4f5ff62 100644 (file)
@@ -50,6 +50,18 @@ gst_compat_video_overlay_rectangle_get_pixels_unscaled_raw(
         &width, &height, &stride, flags);
 }
 
+/* GstElement */
+#undef  gst_element_class_set_static_metadata
+#define gst_element_class_set_static_metadata(klass, name, path, desc, author) \
+    gst_compat_element_class_set_static_metadata(klass, name, path, desc, author)
+
+static inline void
+gst_compat_element_class_set_static_metadata(GstElementClass *klass,
+    const gchar *name, const char *path, const gchar *desc, const gchar *author)
+{
+    gst_element_class_set_details_simple(klass, name, path, desc, author);
+}
+
 /* GstTypeFind */
 #undef  GstTypeFindPeekFunction
 #define GstTypeFindPeekFunction         GstCompatTypeFindPeekFunction
index b1f4bc5..508a323 100644 (file)
 GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapidecode);
 #define GST_CAT_DEFAULT gst_debug_vaapidecode
 
-/* ElementFactory information */
-static const GstElementDetails gst_vaapidecode_details =
-    GST_ELEMENT_DETAILS(
-        "VA-API decoder",
-        "Codec/Decoder/Video",
-        GST_PLUGIN_DESC,
-        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
-
 /* Default templates */
 #define GST_CAPS_CODEC(CODEC) CODEC "; "
 
@@ -563,13 +555,11 @@ gst_vaapidecode_class_init(GstVaapiDecodeClass *klass)
     vdec_class->handle_frame = GST_DEBUG_FUNCPTR(gst_vaapidecode_handle_frame);
     vdec_class->finish       = GST_DEBUG_FUNCPTR(gst_vaapidecode_finish);
 
-    gst_element_class_set_details_simple(
-        element_class,
-        gst_vaapidecode_details.longname,
-        gst_vaapidecode_details.klass,
-        gst_vaapidecode_details.description,
-        gst_vaapidecode_details.author
-    );
+    gst_element_class_set_static_metadata(element_class,
+        "VA-API decoder",
+        "Codec/Decoder/Video",
+        GST_PLUGIN_DESC,
+        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
 
     /* sink pad */
     pad_template = gst_static_pad_template_get(&gst_vaapidecode_sink_factory);
index 5a29501..3000fd9 100644 (file)
 GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapidownload);
 #define GST_CAT_DEFAULT gst_debug_vaapidownload
 
-/* ElementFactory information */
-static const GstElementDetails gst_vaapidownload_details =
-    GST_ELEMENT_DETAILS(
-        "VA-API colorspace converter",
-        "Filter/Converter/Video",
-        GST_PLUGIN_DESC,
-        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
-
 /* Default templates */
 static const char gst_vaapidownload_yuv_caps_str[] =
     "video/x-raw-yuv, "
@@ -237,13 +229,11 @@ gst_vaapidownload_class_init(GstVaapiDownloadClass *klass)
     trans_class->transform_size   = gst_vaapidownload_transform_size;
     trans_class->set_caps         = gst_vaapidownload_set_caps;
 
-    gst_element_class_set_details_simple(
-        element_class,
-        gst_vaapidownload_details.longname,
-        gst_vaapidownload_details.klass,
-        gst_vaapidownload_details.description,
-        gst_vaapidownload_details.author
-    );
+    gst_element_class_set_static_metadata(element_class,
+        "VA-API colorspace converter",
+        "Filter/Converter/Video",
+        GST_PLUGIN_DESC,
+        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
 
     /* sink pad */
     pad_template = gst_static_pad_template_get(&gst_vaapidownload_sink_factory);
index 3172482..b0ea884 100644 (file)
 GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapipostproc);
 #define GST_CAT_DEFAULT gst_debug_vaapipostproc
 
-/* ElementFactory information */
-static const GstElementDetails gst_vaapipostproc_details =
-    GST_ELEMENT_DETAILS(
-        "VA-API video postprocessing",
-        "Filter/Converter/Video",
-        GST_PLUGIN_DESC,
-        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
-
 /* Default templates */
 static const char gst_vaapipostproc_sink_caps_str[] =
     GST_VAAPI_SURFACE_CAPS ", "
@@ -651,13 +643,11 @@ gst_vaapipostproc_class_init(GstVaapiPostprocClass *klass)
 
     element_class->change_state = gst_vaapipostproc_change_state;
 
-    gst_element_class_set_details_simple(
-        element_class,
-        gst_vaapipostproc_details.longname,
-        gst_vaapipostproc_details.klass,
-        gst_vaapipostproc_details.description,
-        gst_vaapipostproc_details.author
-    );
+    gst_element_class_set_static_metadata(element_class,
+        "VA-API video postprocessing",
+        "Filter/Converter/Video",
+        GST_PLUGIN_DESC,
+        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
 
     /* sink pad */
     pad_template = gst_static_pad_template_get(&gst_vaapipostproc_sink_factory);
index 90350de..e81ddde 100644 (file)
 GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapisink);
 #define GST_CAT_DEFAULT gst_debug_vaapisink
 
-/* ElementFactory information */
-static const GstElementDetails gst_vaapisink_details =
-    GST_ELEMENT_DETAILS(
-        "VA-API sink",
-        "Sink/Video",
-        GST_PLUGIN_DESC,
-        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
-
 /* Default template */
 static const char gst_vaapisink_sink_caps_str[] =
     "video/x-raw-yuv, "
@@ -1069,13 +1061,11 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
     basesink_class->query        = gst_vaapisink_query;
     basesink_class->buffer_alloc = gst_vaapisink_buffer_alloc;
 
-    gst_element_class_set_details_simple(
-        element_class,
-        gst_vaapisink_details.longname,
-        gst_vaapisink_details.klass,
-        gst_vaapisink_details.description,
-        gst_vaapisink_details.author
-    );
+    gst_element_class_set_static_metadata(element_class,
+        "VA-API sink",
+        "Sink/Video",
+        GST_PLUGIN_DESC,
+        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
 
     pad_template = gst_static_pad_template_get(&gst_vaapisink_sink_factory);
     gst_element_class_add_pad_template(element_class, pad_template);
index 05941d5..4b4f7c9 100644 (file)
 GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapiupload);
 #define GST_CAT_DEFAULT gst_debug_vaapiupload
 
-/* ElementFactory information */
-static const GstElementDetails gst_vaapiupload_details =
-    GST_ELEMENT_DETAILS(
-        "VA-API colorspace converter",
-        "Filter/Converter/Video",
-        GST_PLUGIN_DESC,
-        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
-
 /* Default templates */
 static const char gst_vaapiupload_yuv_caps_str[] =
     "video/x-raw-yuv, "
@@ -215,13 +207,11 @@ gst_vaapiupload_class_init(GstVaapiUploadClass *klass)
     trans_class->get_unit_size  = gst_vaapiupload_get_unit_size;
     trans_class->prepare_output_buffer = gst_vaapiupload_prepare_output_buffer;
 
-    gst_element_class_set_details_simple(
-        element_class,
-        gst_vaapiupload_details.longname,
-        gst_vaapiupload_details.klass,
-        gst_vaapiupload_details.description,
-        gst_vaapiupload_details.author
-    );
+    gst_element_class_set_static_metadata(element_class,
+        "VA-API colorspace converter",
+        "Filter/Converter/Video",
+        GST_PLUGIN_DESC,
+        "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
 
     /* sink pad */
     pad_template = gst_static_pad_template_get(&gst_vaapiupload_sink_factory);