From: Stéphane Cerveau Date: Tue, 1 Dec 2020 14:14:00 +0000 (+0100) Subject: rawparse: allow per feature registration X-Git-Tag: 1.19.3~511^2~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d3831656dbbe063ead20e50724158a59ffd661d;p=platform%2Fupstream%2Fgstreamer.git rawparse: allow per feature registration Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: --- diff --git a/gst/rawparse/gstrawaudioparse.c b/gst/rawparse/gstrawaudioparse.c index 5ed592f..4817341 100644 --- a/gst/rawparse/gstrawaudioparse.c +++ b/gst/rawparse/gstrawaudioparse.c @@ -77,6 +77,7 @@ #define GLIB_DISABLE_DEPRECATION_WARNINGS #include +#include "gstrawparseelements.h" #include "gstrawaudioparse.h" #include "unalignedaudio.h" @@ -122,6 +123,8 @@ GST_STATIC_PAD_TEMPLATE ("src", #define gst_raw_audio_parse_parent_class parent_class G_DEFINE_TYPE (GstRawAudioParse, gst_raw_audio_parse, GST_TYPE_RAW_BASE_PARSE); +GST_ELEMENT_REGISTER_DEFINE (rawaudioparse, "rawaudioparse", + GST_RANK_NONE, GST_TYPE_RAW_AUDIO_PARSE); static void gst_raw_audio_parse_set_property (GObject * object, guint prop_id, GValue const *value, GParamSpec * pspec); diff --git a/gst/rawparse/gstrawparseelements.h b/gst/rawparse/gstrawparseelements.h new file mode 100644 index 0000000..89da23e --- /dev/null +++ b/gst/rawparse/gstrawparseelements.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) <2020> The GStreamer Contributors. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_RAWPARSE_ELEMENTS_H__ +#define __GST_RAWPARSE_ELEMENTS_H__ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +G_BEGIN_DECLS + +GST_ELEMENT_REGISTER_DECLARE (unalignedaudioparse); +GST_ELEMENT_REGISTER_DECLARE (unalignedvideoparse); +GST_ELEMENT_REGISTER_DECLARE (rawaudioparse); +GST_ELEMENT_REGISTER_DECLARE (rawvideoparse); + +G_END_DECLS + +#endif /* __GST_RAWPARSE_ELEMENTS_H__ */ diff --git a/gst/rawparse/gstrawvideoparse.c b/gst/rawparse/gstrawvideoparse.c index 2b77f05..066dd2a 100644 --- a/gst/rawparse/gstrawvideoparse.c +++ b/gst/rawparse/gstrawvideoparse.c @@ -75,6 +75,7 @@ #endif #include +#include "gstrawparseelements.h" #include "gstrawvideoparse.h" #include "unalignedvideo.h" @@ -127,6 +128,8 @@ GST_STATIC_PAD_TEMPLATE ("src", #define gst_raw_video_parse_parent_class parent_class G_DEFINE_TYPE (GstRawVideoParse, gst_raw_video_parse, GST_TYPE_RAW_BASE_PARSE); +GST_ELEMENT_REGISTER_DEFINE (rawvideoparse, "rawvideoparse", + GST_RANK_NONE, GST_TYPE_RAW_VIDEO_PARSE); static void gst_raw_video_parse_set_property (GObject * object, guint prop_id, GValue const *value, GParamSpec * pspec); diff --git a/gst/rawparse/gstunalignedaudioparse.c b/gst/rawparse/gstunalignedaudioparse.c index 9c57232..12bfe43 100644 --- a/gst/rawparse/gstunalignedaudioparse.c +++ b/gst/rawparse/gstunalignedaudioparse.c @@ -24,6 +24,7 @@ #include #include #include "gstunalignedaudioparse.h" +#include "gstrawparseelements.h" #include "unalignedaudio.h" GST_DEBUG_CATEGORY (unaligned_audio_parse_debug); @@ -51,6 +52,8 @@ GST_STATIC_PAD_TEMPLATE ("src", ); G_DEFINE_TYPE (GstUnalignedAudioParse, gst_unaligned_audio_parse, GST_TYPE_BIN); +GST_ELEMENT_REGISTER_DEFINE (unalignedaudioparse, + "unalignedaudioparse", GST_RANK_MARGINAL, GST_TYPE_UNALIGNED_AUDIO_PARSE); static void gst_unaligned_audio_parse_class_init (GstUnalignedAudioParseClass * klass) diff --git a/gst/rawparse/gstunalignedvideoparse.c b/gst/rawparse/gstunalignedvideoparse.c index 7135f26..cb1e37d 100644 --- a/gst/rawparse/gstunalignedvideoparse.c +++ b/gst/rawparse/gstunalignedvideoparse.c @@ -24,6 +24,7 @@ #include #include #include "gstunalignedvideoparse.h" +#include "gstrawparseelements.h" #include "unalignedvideo.h" GST_DEBUG_CATEGORY (unaligned_video_parse_debug); @@ -50,6 +51,8 @@ GST_STATIC_PAD_TEMPLATE ("src", ); G_DEFINE_TYPE (GstUnalignedVideoParse, gst_unaligned_video_parse, GST_TYPE_BIN); +GST_ELEMENT_REGISTER_DEFINE (unalignedvideoparse, + "unalignedvideoparse", GST_RANK_MARGINAL, GST_TYPE_UNALIGNED_VIDEO_PARSE); static void gst_unaligned_video_parse_class_init (GstUnalignedVideoParseClass * klass) diff --git a/gst/rawparse/plugin.c b/gst/rawparse/plugin.c index 5cc561e..6dd1bb9 100644 --- a/gst/rawparse/plugin.c +++ b/gst/rawparse/plugin.c @@ -1,26 +1,38 @@ +/* + * Copyright (C) <2016> Carlos Rafael Giani + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #ifdef HAVE_CONFIG_H # include "config.h" #endif #include -#include "gstrawaudioparse.h" -#include "gstrawvideoparse.h" -#include "gstunalignedaudioparse.h" -#include "gstunalignedvideoparse.h" + +#include "gstrawparseelements.h" static gboolean plugin_init (GstPlugin * plugin) { - gboolean ret = TRUE; + gboolean ret = FALSE; - ret &= gst_element_register (plugin, "unalignedaudioparse", GST_RANK_MARGINAL, - gst_unaligned_audio_parse_get_type ()); - ret &= gst_element_register (plugin, "unalignedvideoparse", GST_RANK_MARGINAL, - gst_unaligned_video_parse_get_type ()); - ret &= gst_element_register (plugin, "rawaudioparse", GST_RANK_NONE, - gst_raw_audio_parse_get_type ()); - ret &= gst_element_register (plugin, "rawvideoparse", GST_RANK_NONE, - gst_raw_video_parse_get_type ()); + ret |= GST_ELEMENT_REGISTER (unalignedaudioparse, plugin); + ret |= GST_ELEMENT_REGISTER (unalignedvideoparse, plugin); + ret |= GST_ELEMENT_REGISTER (rawaudioparse, plugin); + ret |= GST_ELEMENT_REGISTER (rawvideoparse, plugin); return ret; }