From 2dcc9f19da5a44062521104705e2b8e9e30a30a9 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 20 Mar 2013 18:41:40 +0100 Subject: [PATCH] plugins: use modern GstElement metadata information. 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 | 12 ++++++++++++ gst/vaapi/gstvaapidecode.c | 20 +++++--------------- gst/vaapi/gstvaapidownload.c | 20 +++++--------------- gst/vaapi/gstvaapipostproc.c | 20 +++++--------------- gst/vaapi/gstvaapisink.c | 20 +++++--------------- gst/vaapi/gstvaapiupload.c | 20 +++++--------------- 6 files changed, 37 insertions(+), 75 deletions(-) diff --git a/gst-libs/gst/vaapi/gstcompat.h b/gst-libs/gst/vaapi/gstcompat.h index 8ff3180620..4f5ff6258f 100644 --- a/gst-libs/gst/vaapi/gstcompat.h +++ b/gst-libs/gst/vaapi/gstcompat.h @@ -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 diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index b1f4bc5f4e..508a32356d 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -49,14 +49,6 @@ 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 "); - /* 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 "); /* sink pad */ pad_template = gst_static_pad_template_get(&gst_vaapidecode_sink_factory); diff --git a/gst/vaapi/gstvaapidownload.c b/gst/vaapi/gstvaapidownload.c index 5a29501fc1..3000fd91eb 100644 --- a/gst/vaapi/gstvaapidownload.c +++ b/gst/vaapi/gstvaapidownload.c @@ -43,14 +43,6 @@ 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 "); - /* 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 "); /* sink pad */ pad_template = gst_static_pad_template_get(&gst_vaapidownload_sink_factory); diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 3172482005..b0ea884c85 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -43,14 +43,6 @@ 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 "); - /* 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 "); /* sink pad */ pad_template = gst_static_pad_template_get(&gst_vaapipostproc_sink_factory); diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 90350dec5a..e81ddde436 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -63,14 +63,6 @@ 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 "); - /* 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 "); pad_template = gst_static_pad_template_get(&gst_vaapisink_sink_factory); gst_element_class_add_pad_template(element_class, pad_template); diff --git a/gst/vaapi/gstvaapiupload.c b/gst/vaapi/gstvaapiupload.c index 05941d555c..4b4f7c9600 100644 --- a/gst/vaapi/gstvaapiupload.c +++ b/gst/vaapi/gstvaapiupload.c @@ -44,14 +44,6 @@ 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 "); - /* 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 "); /* sink pad */ pad_template = gst_static_pad_template_get(&gst_vaapiupload_sink_factory);