From 78282374964fda86a3c14d8b7d415e0110cff365 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Mon, 31 Aug 2020 14:05:49 -0400 Subject: [PATCH 1/5] element: add convenience macros to register Define separate macros to define an element apart from the plugin itself. These macros will help to register elements a part from a plugin. By example in the case of a gstreamer static build producing the libgstreamer-full library. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 Part-of: --- gst/gstelement.h | 144 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/gst/gstelement.h b/gst/gstelement.h index c1bfb45f2ad..f550a276567 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -28,6 +28,150 @@ G_BEGIN_DECLS + +/** + * _GST_ELEMENT_REGISTER_DEFINE_BEGIN: (attributes doc.skip=true) + */ +#define _GST_ELEMENT_REGISTER_DEFINE_BEGIN(element) \ +G_BEGIN_DECLS \ +gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \ +{ \ + gboolean ret = FALSE; \ + {\ +G_END_DECLS + +/** + * _GST_ELEMENT_REGISTER_DEFINE_END: (attributes doc.skip=true) + */ +#define _GST_ELEMENT_REGISTER_DEFINE_END(element_name, rank, type) \ +G_BEGIN_DECLS \ + } \ + ret |= gst_element_register (plugin, element_name, rank, type); \ + return ret; \ +} \ +G_END_DECLS + +/** + * GST_ELEMENT_REGISTER_DEFINE_CUSTOM: + * + * @element: The element name in lower case, with words separated by '_'. + * Used to generate `gst_element_register_*(GstPlugin* plugin)`. + * @register_func: pointer to a method with the format: `gboolean register_func (GstPlugin* plugin);` + * + * A convenience macro to define the entry point of an + * element `gst_element_register_*(GstPlugin* plugin)` which uses + * register_func as the main registration method for the element. + * As an example, you may define the element named "streamer-filter" + * with the namespace `my` as following using `element_register_custom`: + * + * ``` + * GST_ELEMENT_REGISTER_DEFINE_CUSTOM (my_element, element_register_custom) + * ``` + * + * Since: 1.20 + */ +#define GST_ELEMENT_REGISTER_DEFINE_CUSTOM(element, register_func) \ +G_BEGIN_DECLS \ +gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \ +{ \ + return register_func (plugin); \ +} \ +G_END_DECLS + +/** + * GST_ELEMENT_REGISTER_DEFINE: + * + * @e: The element name in lower case, with words separated by '_'. + * Used to generate `gst_element_register_*(GstPlugin* plugin)`. + * @e_n: The public name of the element + * @r: The #GstRank of the element (higher rank means more importance when autoplugging, see #GstRank) + * @t: The #GType of the element. + * + * A convenience macro to define the entry point of an + * element `gst_element_register_*(GstPlugin* plugin)`. + * As an example, you may define the element named "streamer-filter" + * with the namespace `my` as following: + * + * ``` + * GST_ELEMENT_REGISTER_REGISTER_DEFINE (stream_filter, "stream-filter", GST_RANK_PRIMARY, MY_TYPE_STREAM_FILTER) + * ``` + * + * Since: 1.20 + */ +#define GST_ELEMENT_REGISTER_DEFINE(e, e_n, r, t) _GST_ELEMENT_REGISTER_DEFINE_BEGIN(e) _GST_ELEMENT_REGISTER_DEFINE_END(e_n, r, t) + +/** + * GST_ELEMENT_REGISTER_DEFINE_WITH_CODE: + * + * @e: The element name in lower case, with words separated by '_'. + * Used to generate `gst_element_register_*(GstPlugin* plugin)`. + * @e_n: The public name of the element + * @r: The #GstRank of the element (higher rank means more importance when autoplugging, see #GstRank) + * @t: The #GType of the element. + * @_c_: Custom code that gets inserted in the gst_element_register_*() function. + * + * A convenience macro to define the entry point of an + * element `gst_element_register_*(GstPlugin* plugin)` executing code + * before gst_element_register in `gst_element_register_*(GstPlugin* plugin)`. + + * As an example, you may define the element named "stream-filter" + * with the namespace `my` as following: + * + * ``` + * #define _pre_register_init \ + * ret |= my_stream_filter_pre_register (plugin); + * GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (stream_filter, "stream-filter", GST_RANK_PRIMARY, MY_TYPE_STREAM_FILTER, _pre_register_init) + * ``` + * + * Since: 1.20 + */ +#define GST_ELEMENT_REGISTER_DEFINE_WITH_CODE(e, e_n, r, t, _c_) _GST_ELEMENT_REGISTER_DEFINE_BEGIN(e) {_c_;} _GST_ELEMENT_REGISTER_DEFINE_END(e_n, r, t) + +/** + * GST_ELEMENT_REGISTER_DECLARE: + * @element: The element name in lower case, with words separated by '_'. + * + * This macro can be used to declare a new element. + * It has to be used in combination with #GST_ELEMENT_REGISTER_DEFINE macros + * and must be placed outside any block to declare the element registration + * function. + * As an example, you may declare the element named "stream-filter" + * with the namespace `my` as following: + * + * ``` + * GST_ELEMENT_REGISTER_DECLARE (stream_filter) + * ``` + * + * Since: 1.20 + */ +#define GST_ELEMENT_REGISTER_DECLARE(element) \ +G_BEGIN_DECLS \ +gboolean G_PASTE(gst_element_register_, element) (GstPlugin * plugin) \ +G_END_DECLS + +/** + * GST_ELEMENT_REGISTER: + * @element: The element name in lower case, with words separated by '_'. + * @plugin: The #GstPlugin where to register the element. + * + * This macro can be used to register an element into a #GstPlugin. + * This method will be usually called in the plugin init function + * but can also be called with a NULL plugin, + * for example with a static registration of the element. + * It has to be used in combination with #GST_ELEMENT_REGISTER_DECLARE. + * + * ``` + * GstPlugin* plugin; + * + * ... + * + * GST_ELEMENT_REGISTER (stream_filter, plugin); + * ``` + * + * Since: 1.20 + */ +#define GST_ELEMENT_REGISTER(element, plugin) G_PASTE(gst_element_register_, element) (plugin) + /* gstelement.h and gstelementfactory.h include each other */ typedef struct _GstElement GstElement; typedef struct _GstElementClass GstElementClass; -- GitLab From ff36ce0051eba428f7ebcea36ecf9e5dbebf953a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Fri, 27 Nov 2020 17:33:33 +0100 Subject: [PATCH 2/5] device provider: add convenience macros to register This macros will help to register a device provider apart from a given plugin such as in a static build of gstreamer where libgstreamer-full is generated. Part-of: --- gst/gstdeviceprovider.h | 51 +++++++++++++++++++++++++++++++++++++ tests/check/gst/gstdevice.c | 10 +++++--- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/gst/gstdeviceprovider.h b/gst/gstdeviceprovider.h index cafe37e1cac..ba8c5210cf6 100644 --- a/gst/gstdeviceprovider.h +++ b/gst/gstdeviceprovider.h @@ -26,6 +26,57 @@ #include +/** + * GST_DEVICE_PROVIDER_REGISTER_DEFINE: + * + * @d_p: The device provider name in lower case, with words separated by '_'. + * Used to generate `gst_device_provider_register_*(GstPlugin* plugin)`. + * @d_p_n: The public name of the device provider + * @r: The #GstRank of the device provider (higher rank means more importance when autoplugging, see #GstRank) + * @t: The #GType of the device provider. + * + * A convenience macro to define the entry point of a + * device provider `gst_device_provider_register_*(GstPlugin* plugin)`. + * + * Since: 1.20 + */ +#define GST_DEVICE_PROVIDER_REGISTER_DEFINE(d_p, d_p_n, r, t) \ +G_BEGIN_DECLS \ +gboolean G_PASTE (gst_device_provider_register_, d_p) (GstPlugin * plugin) \ +{ \ + return gst_device_provider_register (plugin, d_p_n, r, t); \ +} \ +G_END_DECLS + +/** + * GST_DEVICE_PROVIDER_REGISTER_DECLARE: + * @d_p: The device provider name in lower case, with words separated by '_'. + * + * This macro can be used to declare a new device provider. + * It has to be used in combination with #GST_DEVICE_PROVIDER_REGISTER_DEFINE macro + * and must be placed outside any block to declare the device provider registration + * function. + * + * Since: 1.20 + */ +#define GST_DEVICE_PROVIDER_REGISTER_DECLARE(d_p) \ +G_BEGIN_DECLS \ +gboolean G_PASTE(gst_device_provider_register_, d_p) (GstPlugin * plugin); \ +G_END_DECLS + +/** + * GST_DEVICE_PROVIDER_REGISTER: + * @d_p: The device provider name in lower case, with words separated by '_'. + * @plugin: The #GstPlugin where to register the device provider. + * + * This macro can be used to register a device provider into a #GstPlugin. + * This method will be usually called in the plugin init function + * but can also be called with a NULL plugin. + * + * Since: 1.20 + */ +#define GST_DEVICE_PROVIDER_REGISTER(d_p, plugin) G_PASTE(gst_device_provider_register_, d_p) (plugin) + G_BEGIN_DECLS typedef struct _GstDeviceProvider GstDeviceProvider; diff --git a/tests/check/gst/gstdevice.c b/tests/check/gst/gstdevice.c index 8d472360808..0c4d91f12e3 100644 --- a/tests/check/gst/gstdevice.c +++ b/tests/check/gst/gstdevice.c @@ -174,8 +174,12 @@ gst_test_device_provider_init (GstTestDeviceProvider * self) { } -static void -register_test_device_provider (void) +GST_DEVICE_PROVIDER_REGISTER_DECLARE (testdeviceprovider); + +GST_DEVICE_PROVIDER_REGISTER_DEFINE (testdeviceprovider, "testdeviceprovider", + 1, gst_test_device_provider_get_type ()) + + static void register_test_device_provider (void) { gst_device_provider_register (NULL, "testdeviceprovider", 1, gst_test_device_provider_get_type ()); @@ -187,7 +191,7 @@ GST_START_TEST (test_device_provider_factory) GList *factories; GstDeviceProviderFactory *f; - register_test_device_provider (); + GST_DEVICE_PROVIDER_REGISTER (testdeviceprovider, NULL); factories = gst_device_provider_factory_list_get_device_providers (1); -- GitLab From 9fd20cf1a001dfa6b60325a584ed9bbd2faba97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Mon, 30 Nov 2020 11:51:59 +0100 Subject: [PATCH 3/5] type find: add convenience macros to register This macros will help to register a device provider apart from a given plugin such as in a static build of gstreamer where libgstreamer-full is generated. Part-of: --- gst/gsttypefind.h | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/gst/gsttypefind.h b/gst/gsttypefind.h index 1c7f12b2103..bcd336f1523 100644 --- a/gst/gsttypefind.h +++ b/gst/gsttypefind.h @@ -28,6 +28,93 @@ #include G_BEGIN_DECLS +/** + * GST_TYPE_FIND_REGISTER_DEFINE_CUSTOM: + * + * @type_find: The type find name in lower case, with words separated by '_'. + * Used to generate `gst_type_find_register_*(GstPlugin* plugin)`. + * @register_func: pointer to a method with the format: `gboolean register_func (GstPlugin* plugin);` + * + * A convenience macro to define the entry point of a + * type find `gst_type_find_register_*(GstPlugin* plugin)` which uses + * register_func as the main registration method for the type find. + * As an example, you may define the type find named "custom-typefind" + * as following using `type_find_register_custom`: + * + * ``` + * GST_TYPE_FIND_REGISTER_DEFINE_CUSTOM (plugin, type_find_register_custom) + * ``` + * + * Since: 1.20 + */ +#define GST_TYPE_FIND_REGISTER_DEFINE_CUSTOM(type_find, register_func) \ +G_BEGIN_DECLS \ +gboolean G_PASTE (gst_type_find_register_, type_find) (GstPlugin * plugin) \ +{ \ + return register_func (plugin); \ +} \ +G_END_DECLS + +/** + * GST_TYPE_FIND_REGISTER_DEFINE: + * + * @t_f: The type find name in lower case, with words separated by '_'. + * Used to generate `gst_type_find_register_*(GstPlugin* plugin)`. + * @t_f_n: The public name of the type find + * @r: The #GstRank of the type find (higher rank means more importance when autoplugging, see #GstRank) + * @func: The #GstTypeFindFunction to use + * @extensions: (nullable): Optional comma-separated list of extensions + * that could belong to this type + * @possible_caps: (nullable): Optionally the caps that could be returned when typefinding + * succeeds + * @data: Optional user data. This user data must be available until the plugin + * is unloaded. + * @data_notify: a #GDestroyNotify that will be called on @data when the plugin + * is unloaded. + * + * A convenience macro to define the entry point of a + * type find `gst_type_find_register_*(GstPlugin* plugin)`. + * + * Since: 1.20 + */ +#define GST_TYPE_FIND_REGISTER_DEFINE(t_f, t_f_n, r, func, extensions, possible_caps, data, data_notify) \ +G_BEGIN_DECLS \ +gboolean G_PASTE (gst_type_find_register_, t_f) (GstPlugin * plugin) \ +{ \ + return gst_type_find_register (plugin, t_f_n, r, func, extensions, possible_caps, data, data_notify); \ +} \ +G_END_DECLS + +/** + * GST_TYPE_FIND_REGISTER_DECLARE: + * @t_f: The type find name in lower case, with words separated by '_'. + * + * This macro can be used to declare a new type find. + * It has to be used in combination with #GST_TYPE_FIND_REGISTER_DEFINE macro + * and must be placed outside any block to declare the type find registration + * function. + * + * Since: 1.20 + */ +#define GST_TYPE_FIND_REGISTER_DECLARE(t_f) \ +G_BEGIN_DECLS \ +gboolean G_PASTE(gst_type_find_register_, t_f) (GstPlugin * plugin); \ +G_END_DECLS + +/** + * GST_TYPE_FIND_REGISTER: + * @t_f: The type find name in lower case, with words separated by '_'. + * @plugin: The #GstPlugin where to register the type find. + + * + * This macro can be used to register a type find into a #GstPlugin. + * This method will be usually called in the plugin init function + * but can also be called with a NULL plugin. + * + * Since: 1.20 + */ +#define GST_TYPE_FIND_REGISTER(t_f, plugin) G_PASTE(gst_type_find_register_, t_f) (plugin) + #define GST_TYPE_TYPE_FIND (gst_type_find_get_type()) -- GitLab From a41f37d94c2d9837c28bf021e47b3c9a672f17b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 1 Dec 2020 12:46:19 +0100 Subject: [PATCH 4/5] dynamic type: add convenience macros to register This macros will help to register a dynamic type apart from a given plugin such as in a static build of gstreamer where libgstreamer-full is generated. Part-of: --- gst/gstdynamictypefactory.h | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gst/gstdynamictypefactory.h b/gst/gstdynamictypefactory.h index c8ac3c675f9..95b60181ce7 100644 --- a/gst/gstdynamictypefactory.h +++ b/gst/gstdynamictypefactory.h @@ -22,6 +22,55 @@ #ifndef __GST_DYNAMIC_TYPE_FACTORY_H__ #define __GST_DYNAMIC_TYPE_FACTORY_H__ +/** + * GST_DYNAMIC_TYPE_REGISTER_DEFINE: + * + * @t_n: The dynamic type name in lower case, with words separated by '_'. + * Used to generate `gst_dynamic_type_register_*(GstPlugin* plugin)`. + * @t: The #GType of the dynamic type + + * A convenience macro to define the entry point of a + * dynamic type `gst_dynamic_type_register_*(GstPlugin* plugin)`. + * + * Since: 1.20 + */ +#define GST_DYNAMIC_TYPE_REGISTER_DEFINE(t_n, t) \ +G_BEGIN_DECLS \ +gboolean G_PASTE (gst_dynamic_type_register_, t_n) (GstPlugin * plugin) \ +{ \ + return gst_dynamic_type_register (plugin, t); \ +} \ +G_END_DECLS + +/** + * GST_DYNAMIC_TYPE_REGISTER_DECLARE: + * @t_f: The dynamic type name in lower case, with words separated by '_'. + * + * This macro can be used to declare a new dynamic type. + * It has to be used in combination with #GST_DYNAMIC_TYPE_REGISTER_DEFINE macro + * and must be placed outside any block to declare the type find registration + * function. + * + * Since: 1.20 + */ +#define GST_DYNAMIC_TYPE_REGISTER_DECLARE(t_n) \ +G_BEGIN_DECLS \ +gboolean G_PASTE(gst_dynamic_type_register_, t_n) (GstPlugin * plugin); \ +G_END_DECLS + +/** + * GST_DYNAMIC_TYPE_REGISTER: + * @t_n: The dynamic type name to register + * @plugin: The #GstPlugin where to register the dynamic type. + * + * This macro can be used to register a dynamic type into a #GstPlugin. + * This method will be usually called in the plugin init function + * but can also be called with a NULL plugin. + * + * Since: 1.20 + */ +#define GST_DYNAMIC_TYPE_REGISTER(t_n, plugin) G_PASTE(gst_dynamic_type_register_, t_n) (plugin) + /** * GstDynamicTypeFactory: * -- GitLab From 783e19b04c781a6aac7882b000ce8d3ebaab2b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 6 Oct 2020 14:26:30 +0200 Subject: [PATCH 5/5] coreelements: allow per features 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: --- plugins/elements/gstcapsfilter.c | 3 + plugins/elements/gstclocksync.c | 3 + plugins/elements/gstconcat.c | 2 + plugins/elements/gstcoreelementselements.h | 54 +++++++++ plugins/elements/gstcoreelementsplugin.c | 72 +++++++++++ plugins/elements/gstdataurisrc.c | 3 + plugins/elements/gstdownloadbuffer.c | 3 + plugins/elements/gstelements.c | 134 --------------------- plugins/elements/gstfakesink.c | 6 +- plugins/elements/gstfakesrc.c | 3 + plugins/elements/gstfdsink.c | 4 + plugins/elements/gstfdsrc.c | 4 + plugins/elements/gstfilesink.c | 3 + plugins/elements/gstfilesrc.c | 3 + plugins/elements/gstfunnel.c | 2 + plugins/elements/gstidentity.c | 3 + plugins/elements/gstinputselector.c | 3 + plugins/elements/gstmultiqueue.c | 6 +- plugins/elements/gstoutputselector.c | 3 + plugins/elements/gstqueue.c | 2 + plugins/elements/gstqueue2.c | 2 + plugins/elements/gststreamiddemux.c | 3 + plugins/elements/gsttee.c | 2 + plugins/elements/gsttypefindelement.c | 3 + plugins/elements/gstvalve.c | 2 + plugins/elements/meson.build | 2 +- 26 files changed, 193 insertions(+), 137 deletions(-) create mode 100644 plugins/elements/gstcoreelementselements.h create mode 100644 plugins/elements/gstcoreelementsplugin.c delete mode 100644 plugins/elements/gstelements.c diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c index 79128d7272b..438f6e1f040 100644 --- a/plugins/elements/gstcapsfilter.c +++ b/plugins/elements/gstcapsfilter.c @@ -42,6 +42,7 @@ #include "../../gst/gst-i18n-lib.h" #include "gstcapsfilter.h" +#include "gstcoreelementselements.h" enum { @@ -93,6 +94,8 @@ gst_caps_filter_caps_change_mode_get_type (void) G_DEFINE_TYPE_WITH_CODE (GstCapsFilter, gst_capsfilter, GST_TYPE_BASE_TRANSFORM, _do_init); +GST_ELEMENT_REGISTER_DEFINE (capsfilter, "capsfilter", GST_RANK_NONE, + GST_TYPE_CAPS_FILTER); static void gst_capsfilter_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/plugins/elements/gstclocksync.c b/plugins/elements/gstclocksync.c index 807c84265f9..4d5d3e2544f 100644 --- a/plugins/elements/gstclocksync.c +++ b/plugins/elements/gstclocksync.c @@ -48,6 +48,7 @@ #include #include "gstclocksync.h" +#include "gstcoreelementselements.h" GST_DEBUG_CATEGORY_STATIC (gst_clock_sync_debug); #define GST_CAT_DEFAULT gst_clock_sync_debug @@ -80,6 +81,8 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", #define gst_clock_sync_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstClockSync, gst_clock_sync, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (clocksync, "clocksync", GST_RANK_NONE, + GST_TYPE_CLOCKSYNC); static void gst_clock_sync_finalize (GObject * object); diff --git a/plugins/elements/gstconcat.c b/plugins/elements/gstconcat.c index 049554605a5..659edea8ae0 100644 --- a/plugins/elements/gstconcat.c +++ b/plugins/elements/gstconcat.c @@ -50,6 +50,7 @@ #endif #include "gstconcat.h" +#include "gstcoreelementselements.h" GST_DEBUG_CATEGORY_STATIC (gst_concat_debug); #define GST_CAT_DEFAULT gst_concat_debug @@ -118,6 +119,7 @@ enum GST_DEBUG_CATEGORY_INIT (gst_concat_debug, "concat", 0, "concat element"); #define gst_concat_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstConcat, gst_concat, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (concat, "concat", GST_RANK_NONE, GST_TYPE_CONCAT); static void gst_concat_dispose (GObject * object); static void gst_concat_finalize (GObject * object); diff --git a/plugins/elements/gstcoreelementselements.h b/plugins/elements/gstcoreelementselements.h new file mode 100644 index 00000000000..fa930aafe7b --- /dev/null +++ b/plugins/elements/gstcoreelementselements.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2020 Huawei Technologies Co., Ltd. + * @Author: Stéphane Cerveau + * + * 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_CORE_ELEMENTS_ELEMENTS_H__ +#define __GST_CORE_ELEMENTS_ELEMENTS_H__ + +#include + +G_BEGIN_DECLS + +GST_ELEMENT_REGISTER_DECLARE (capsfilter); +GST_ELEMENT_REGISTER_DECLARE (clocksync); +GST_ELEMENT_REGISTER_DECLARE (concat); +GST_ELEMENT_REGISTER_DECLARE (dataurisrc); +GST_ELEMENT_REGISTER_DECLARE (downloadbuffer); +GST_ELEMENT_REGISTER_DECLARE (fakesink); +GST_ELEMENT_REGISTER_DECLARE (fakesrc); +#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER) +GST_ELEMENT_REGISTER_DECLARE (fdsrc); +GST_ELEMENT_REGISTER_DECLARE (fdsink); +#endif +GST_ELEMENT_REGISTER_DECLARE (filesink); +GST_ELEMENT_REGISTER_DECLARE (filesrc); +GST_ELEMENT_REGISTER_DECLARE (funnel); +GST_ELEMENT_REGISTER_DECLARE (identity); +GST_ELEMENT_REGISTER_DECLARE (input_selector); +GST_ELEMENT_REGISTER_DECLARE (multiqueue); +GST_ELEMENT_REGISTER_DECLARE (output_selector); +GST_ELEMENT_REGISTER_DECLARE (queue); +GST_ELEMENT_REGISTER_DECLARE (queue2); +GST_ELEMENT_REGISTER_DECLARE (streamiddemux); +GST_ELEMENT_REGISTER_DECLARE (tee); +GST_ELEMENT_REGISTER_DECLARE (typefind); +GST_ELEMENT_REGISTER_DECLARE (valve); + +G_END_DECLS + +#endif /* __GST_CORE_ELEMENTS_ELEMENTS_H__ */ diff --git a/plugins/elements/gstcoreelementsplugin.c b/plugins/elements/gstcoreelementsplugin.c new file mode 100644 index 00000000000..82ea0d54a42 --- /dev/null +++ b/plugins/elements/gstcoreelementsplugin.c @@ -0,0 +1,72 @@ +/* GStreamer + * Copyright (C) 1999,2000 Erik Walthinsen + * 2000 Wim Taymans + * + * gstelementsplugin.c: + * + * 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. + */ +/** + * plugin-coreelements: + * + * GStreamer core elements + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#include "gstcoreelementselements.h" + + +static gboolean +plugin_init (GstPlugin * plugin) +{ + gboolean ret = FALSE; + + ret |= GST_ELEMENT_REGISTER (capsfilter, plugin); + ret |= GST_ELEMENT_REGISTER (clocksync, plugin); + ret |= GST_ELEMENT_REGISTER (concat, plugin); + ret |= GST_ELEMENT_REGISTER (dataurisrc, plugin); + ret |= GST_ELEMENT_REGISTER (downloadbuffer, plugin); + ret |= GST_ELEMENT_REGISTER (fakesrc, plugin); + ret |= GST_ELEMENT_REGISTER (fakesink, plugin); +#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER) + ret |= GST_ELEMENT_REGISTER (fdsrc, plugin); + ret |= GST_ELEMENT_REGISTER (fdsink, plugin); +#endif + ret |= GST_ELEMENT_REGISTER (filesrc, plugin); + ret |= GST_ELEMENT_REGISTER (funnel, plugin); + ret |= GST_ELEMENT_REGISTER (identity, plugin); + ret |= GST_ELEMENT_REGISTER (input_selector, plugin); + ret |= GST_ELEMENT_REGISTER (output_selector, plugin); + ret |= GST_ELEMENT_REGISTER (queue, plugin); + ret |= GST_ELEMENT_REGISTER (queue2, plugin); + ret |= GST_ELEMENT_REGISTER (filesink, plugin); + ret |= GST_ELEMENT_REGISTER (tee, plugin); + ret |= GST_ELEMENT_REGISTER (typefind, plugin); + ret |= GST_ELEMENT_REGISTER (multiqueue, plugin); + ret |= GST_ELEMENT_REGISTER (valve, plugin); + ret |= GST_ELEMENT_REGISTER (streamiddemux, plugin); + + return ret; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, coreelements, + "GStreamer core elements", plugin_init, VERSION, GST_LICENSE, + GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/plugins/elements/gstdataurisrc.c b/plugins/elements/gstdataurisrc.c index 8129cb32075..a6132b53be8 100644 --- a/plugins/elements/gstdataurisrc.c +++ b/plugins/elements/gstdataurisrc.c @@ -38,6 +38,7 @@ #endif #include "gstdataurisrc.h" +#include "gstcoreelementselements.h" #include #include @@ -82,6 +83,8 @@ static gboolean gst_data_uri_src_set_uri (GstURIHandler * handler, G_DEFINE_TYPE_WITH_CODE (GstDataURISrc, gst_data_uri_src, GST_TYPE_BASE_SRC, G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_data_uri_src_handler_init)); +GST_ELEMENT_REGISTER_DEFINE (dataurisrc, "dataurisrc", GST_RANK_PRIMARY, + GST_TYPE_DATA_URI_SRC); static void gst_data_uri_src_class_init (GstDataURISrcClass * klass) diff --git a/plugins/elements/gstdownloadbuffer.c b/plugins/elements/gstdownloadbuffer.c index 5e11133e8ba..4dc96f1131d 100644 --- a/plugins/elements/gstdownloadbuffer.c +++ b/plugins/elements/gstdownloadbuffer.c @@ -53,6 +53,7 @@ #endif #include "gstdownloadbuffer.h" +#include "gstcoreelementselements.h" #include @@ -170,6 +171,8 @@ enum #define gst_download_buffer_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstDownloadBuffer, gst_download_buffer, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (downloadbuffer, "downloadbuffer", GST_RANK_NONE, + GST_TYPE_DOWNLOAD_BUFFER); static GstMessage *update_buffering (GstDownloadBuffer * dlbuf); diff --git a/plugins/elements/gstelements.c b/plugins/elements/gstelements.c deleted file mode 100644 index 5ed328c2a5f..00000000000 --- a/plugins/elements/gstelements.c +++ /dev/null @@ -1,134 +0,0 @@ -/* GStreamer - * Copyright (C) 1999,2000 Erik Walthinsen - * 2000 Wim Taymans - * - * gstelements.c: - * - * 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. - */ -/** - * plugin-coreelements: - * - * GStreamer core elements - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include - -#include "gstcapsfilter.h" -#include "gstclocksync.h" -#include "gstconcat.h" -#include "gstdataurisrc.h" -#include "gstdownloadbuffer.h" -#include "gstfakesink.h" -#include "gstfakesrc.h" -#include "gstfdsrc.h" -#include "gstfdsink.h" -#include "gstfilesink.h" -#include "gstfilesrc.h" -#include "gstfunnel.h" -#include "gstidentity.h" -#include "gstinputselector.h" -#include "gstoutputselector.h" -#include "gstmultiqueue.h" -#include "gstqueue.h" -#include "gstqueue2.h" -#include "gsttee.h" -#include "gsttypefindelement.h" -#include "gstvalve.h" -#include "gststreamiddemux.h" - -static gboolean -plugin_init (GstPlugin * plugin) -{ - if (!gst_element_register (plugin, "capsfilter", GST_RANK_NONE, - gst_capsfilter_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "clocksync", GST_RANK_NONE, - gst_clock_sync_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "concat", GST_RANK_NONE, - gst_concat_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "dataurisrc", GST_RANK_PRIMARY, - gst_data_uri_src_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "downloadbuffer", GST_RANK_NONE, - gst_download_buffer_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "fakesrc", GST_RANK_NONE, - gst_fake_src_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "fakesink", GST_RANK_NONE, - gst_fake_sink_get_type ())) - return FALSE; -#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER) - if (!gst_element_register (plugin, "fdsrc", GST_RANK_NONE, - gst_fd_src_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "fdsink", GST_RANK_NONE, - gst_fd_sink_get_type ())) - return FALSE; -#endif - if (!gst_element_register (plugin, "filesrc", GST_RANK_PRIMARY, - gst_file_src_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "funnel", GST_RANK_NONE, - gst_funnel_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "identity", GST_RANK_NONE, - gst_identity_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "input-selector", GST_RANK_NONE, - gst_input_selector_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "output-selector", GST_RANK_NONE, - gst_output_selector_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "queue", GST_RANK_NONE, - gst_queue_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "queue2", GST_RANK_NONE, - gst_queue2_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "filesink", GST_RANK_PRIMARY, - gst_file_sink_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "tee", GST_RANK_NONE, gst_tee_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "typefind", GST_RANK_NONE, - gst_type_find_element_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "multiqueue", GST_RANK_NONE, - gst_multi_queue_get_type ())) - return FALSE; - if (!gst_element_register (plugin, "valve", GST_RANK_NONE, - gst_valve_get_type ())) - return FALSE; - - if (!gst_element_register (plugin, "streamiddemux", GST_RANK_PRIMARY, - gst_streamid_demux_get_type ())) - return FALSE; - - return TRUE; -} - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, coreelements, - "GStreamer core elements", plugin_init, VERSION, GST_LICENSE, - GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c index 05acdc95b15..028c87adfba 100644 --- a/plugins/elements/gstfakesink.c +++ b/plugins/elements/gstfakesink.c @@ -37,9 +37,11 @@ # include "config.h" #endif +#include + #include "gstelements_private.h" #include "gstfakesink.h" -#include +#include "gstcoreelementselements.h" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, @@ -116,6 +118,8 @@ gst_fake_sink_state_error_get_type (void) #define _do_init \ GST_DEBUG_CATEGORY_INIT (gst_fake_sink_debug, "fakesink", 0, "fakesink element"); #define gst_fake_sink_parent_class parent_class +GST_ELEMENT_REGISTER_DEFINE (fakesink, "fakesink", GST_RANK_NONE, + GST_TYPE_FAKE_SINK); G_DEFINE_TYPE_WITH_CODE (GstFakeSink, gst_fake_sink, GST_TYPE_BASE_SINK, _do_init); diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 6a6ad46fc6e..24c27661789 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -51,6 +51,7 @@ #include "gstelements_private.h" #include "gstfakesrc.h" +#include "gstcoreelementselements.h" static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, @@ -203,6 +204,8 @@ gst_fake_src_filltype_get_type (void) GST_DEBUG_CATEGORY_INIT (gst_fake_src_debug, "fakesrc", 0, "fakesrc element"); #define gst_fake_src_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstFakeSrc, gst_fake_src, GST_TYPE_BASE_SRC, _do_init); +GST_ELEMENT_REGISTER_DEFINE (fakesrc, "fakesrc", GST_RANK_NONE, + GST_TYPE_FAKE_SRC); static void gst_fake_src_finalize (GObject * object); static void gst_fake_src_set_property (GObject * object, guint prop_id, diff --git a/plugins/elements/gstfdsink.c b/plugins/elements/gstfdsink.c index 5cf34883418..ad69ec08823 100644 --- a/plugins/elements/gstfdsink.c +++ b/plugins/elements/gstfdsink.c @@ -60,6 +60,7 @@ #include "gstfdsink.h" #include "gstelements_private.h" +#include "gstcoreelementselements.h" #ifdef G_OS_WIN32 #include /* lseek, open, close, read */ @@ -110,6 +111,9 @@ static void gst_fd_sink_uri_handler_init (gpointer g_iface, GST_DEBUG_CATEGORY_INIT (gst_fd_sink__debug, "fdsink", 0, "fdsink element"); #define gst_fd_sink_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstFdSink, gst_fd_sink, GST_TYPE_BASE_SINK, _do_init); +#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER) +GST_ELEMENT_REGISTER_DEFINE (fdsink, "fdsink", GST_RANK_NONE, GST_TYPE_FD_SINK); +#endif static void gst_fd_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index 77017e27755..f88d38e36af 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -79,6 +79,7 @@ #include #include "gstfdsrc.h" +#include "gstcoreelementselements.h" #define struct_stat struct stat @@ -119,6 +120,9 @@ static void gst_fd_src_uri_handler_init (gpointer g_iface, gpointer iface_data); GST_DEBUG_CATEGORY_INIT (gst_fd_src_debug, "fdsrc", 0, "fdsrc element"); #define gst_fd_src_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstFdSrc, gst_fd_src, GST_TYPE_PUSH_SRC, _do_init); +#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER) +GST_ELEMENT_REGISTER_DEFINE (fdsrc, "fdsrc", GST_RANK_NONE, GST_TYPE_FD_SRC); +#endif static void gst_fd_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index 29bb9de902c..1caa2373a55 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -73,6 +73,7 @@ #include "gstelements_private.h" #include "gstfilesink.h" +#include "gstcoreelementselements.h" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, @@ -214,6 +215,8 @@ static GstFlowReturn gst_file_sink_flush_buffer (GstFileSink * filesink); #define gst_file_sink_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstFileSink, gst_file_sink, GST_TYPE_BASE_SINK, _do_init); +GST_ELEMENT_REGISTER_DEFINE (filesink, "filesink", GST_RANK_PRIMARY, + GST_TYPE_FILE_SINK); static void gst_file_sink_class_init (GstFileSinkClass * klass) diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index a31eb32fc26..bcd58d8c6a0 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -39,6 +39,7 @@ #include #include "gstfilesrc.h" +#include "gstcoreelementselements.h" #include #include @@ -168,6 +169,8 @@ static void gst_file_src_uri_handler_init (gpointer g_iface, GST_DEBUG_CATEGORY_INIT (gst_file_src_debug, "filesrc", 0, "filesrc element"); #define gst_file_src_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstFileSrc, gst_file_src, GST_TYPE_BASE_SRC, _do_init); +GST_ELEMENT_REGISTER_DEFINE (filesrc, "filesrc", GST_RANK_PRIMARY, + GST_TYPE_FILE_SRC); static void gst_file_src_class_init (GstFileSrcClass * klass) diff --git a/plugins/elements/gstfunnel.c b/plugins/elements/gstfunnel.c index 8827f492c9a..cdb22c905e3 100644 --- a/plugins/elements/gstfunnel.c +++ b/plugins/elements/gstfunnel.c @@ -38,6 +38,7 @@ #endif #include "gstfunnel.h" +#include "gstcoreelementselements.h" GST_DEBUG_CATEGORY_STATIC (gst_funnel_debug); #define GST_CAT_DEFAULT gst_funnel_debug @@ -106,6 +107,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_DEBUG_CATEGORY_INIT (gst_funnel_debug, "funnel", 0, "funnel element"); #define gst_funnel_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstFunnel, gst_funnel, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (funnel, "funnel", GST_RANK_NONE, GST_TYPE_FUNNEL); static GstStateChangeReturn gst_funnel_change_state (GstElement * element, GstStateChange transition); diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index af477649d6d..74b9f737f87 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -38,6 +38,7 @@ #include "gstelements_private.h" #include "../../gst/gst-i18n-lib.h" #include "gstidentity.h" +#include "gstcoreelementselements.h" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, @@ -105,6 +106,8 @@ enum #define gst_identity_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstIdentity, gst_identity, GST_TYPE_BASE_TRANSFORM, _do_init); +GST_ELEMENT_REGISTER_DEFINE (identity, "identity", GST_RANK_NONE, + GST_TYPE_IDENTITY); static void gst_identity_finalize (GObject * object); static void gst_identity_set_property (GObject * object, guint prop_id, diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 107f3205f0a..4d509e2f2b6 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -48,6 +48,7 @@ #include #include "gstinputselector.h" +#include "gstcoreelementselements.h" #define DEBUG_CACHED_BUFFERS 0 @@ -1213,6 +1214,8 @@ static gboolean gst_input_selector_query (GstPad * pad, GstObject * parent, #define gst_input_selector_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstInputSelector, gst_input_selector, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (input_selector, "input-selector", GST_RANK_NONE, + GST_TYPE_INPUT_SELECTOR); static void gst_input_selector_class_init (GstInputSelectorClass * klass) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 98d27aa75e4..e0f2ab066d5 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -95,9 +95,11 @@ #endif #include +#include #include + #include "gstmultiqueue.h" -#include +#include "gstcoreelementselements.h" /* GstSingleQueue: * @sinkpad: associated sink #GstPad @@ -629,6 +631,8 @@ static void gst_multi_queue_loop (GstPad * pad); #define gst_multi_queue_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstMultiQueue, gst_multi_queue, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (multiqueue, "multiqueue", GST_RANK_NONE, + GST_TYPE_MULTI_QUEUE); static guint gst_multi_queue_signals[LAST_SIGNAL] = { 0 }; diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c index d3270a6f85a..1a1a3fb9083 100644 --- a/plugins/elements/gstoutputselector.c +++ b/plugins/elements/gstoutputselector.c @@ -32,6 +32,7 @@ #include #include "gstoutputselector.h" +#include "gstcoreelementselements.h" GST_DEBUG_CATEGORY_STATIC (output_selector_debug); #define GST_CAT_DEFAULT output_selector_debug @@ -85,6 +86,8 @@ GST_DEBUG_CATEGORY_INIT (output_selector_debug, \ #define gst_output_selector_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstOutputSelector, gst_output_selector, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (output_selector, "output-selector", GST_RANK_NONE, + GST_TYPE_OUTPUT_SELECTOR); static void gst_output_selector_dispose (GObject * object); static void gst_output_selector_set_property (GObject * object, diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 97267625414..e381083a87a 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -60,6 +60,7 @@ #include #include "gstqueue.h" +#include "gstcoreelementselements.h" #include "../../gst/gst-i18n-lib.h" #include "../../gst/glib-compat-private.h" @@ -187,6 +188,7 @@ enum "dataflow inside the queue element"); #define gst_queue_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstQueue, gst_queue, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (queue, "queue", GST_RANK_NONE, GST_TYPE_QUEUE); static void gst_queue_finalize (GObject * object); static void gst_queue_set_property (GObject * object, diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index cb230b31ad2..e61caaebff4 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -62,6 +62,7 @@ #endif #include "gstqueue2.h" +#include "gstcoreelementselements.h" #include @@ -270,6 +271,7 @@ static GParamSpec *obj_props[PROP_LAST] = { NULL, }; "dataflow inside the queue element"); #define gst_queue2_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstQueue2, gst_queue2, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (queue2, "queue2", GST_RANK_NONE, GST_TYPE_QUEUE2); static void gst_queue2_finalize (GObject * object); diff --git a/plugins/elements/gststreamiddemux.c b/plugins/elements/gststreamiddemux.c index f0b1dd29b50..fdc5636dfba 100644 --- a/plugins/elements/gststreamiddemux.c +++ b/plugins/elements/gststreamiddemux.c @@ -47,6 +47,7 @@ #include #include "gststreamiddemux.h" +#include "gstcoreelementselements.h" GST_DEBUG_CATEGORY_STATIC (streamid_demux_debug); #define GST_CAT_DEFAULT streamid_demux_debug @@ -76,6 +77,8 @@ GST_DEBUG_CATEGORY_INIT (streamid_demux_debug, \ #define gst_streamid_demux_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstStreamidDemux, gst_streamid_demux, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (streamiddemux, "streamiddemux", GST_RANK_PRIMARY, + GST_TYPE_STREAMID_DEMUX); static void gst_streamid_demux_dispose (GObject * object); static void gst_streamid_demux_get_property (GObject * object, guint prop_id, diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index ab5183e103e..dd90c386714 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -50,6 +50,7 @@ #endif #include "gsttee.h" +#include "gstcoreelementselements.h" #include "gst/glib-compat-private.h" #include @@ -109,6 +110,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src_%u", GST_DEBUG_CATEGORY_INIT (gst_tee_debug, "tee", 0, "tee element"); #define gst_tee_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstTee, gst_tee, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (tee, "tee", GST_RANK_NONE, GST_TYPE_TEE); static GParamSpec *pspec_last_message = NULL; static GParamSpec *pspec_alloc_pad = NULL; diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 2259bd428e4..fb14df69b37 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -73,6 +73,7 @@ #include "gst/gst_private.h" #include "gsttypefindelement.h" +#include "gstcoreelementselements.h" #include "gst/gst-i18n-lib.h" #include "gst/base/gsttypefindhelper.h" @@ -129,6 +130,8 @@ enum #define gst_type_find_element_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstTypeFindElement, gst_type_find_element, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (typefind, "typefind", GST_RANK_NONE, + GST_TYPE_TYPE_FIND_ELEMENT); static void gst_type_find_element_dispose (GObject * object); static void gst_type_find_element_set_property (GObject * object, diff --git a/plugins/elements/gstvalve.c b/plugins/elements/gstvalve.c index f8f9682e490..bbb3527739c 100644 --- a/plugins/elements/gstvalve.c +++ b/plugins/elements/gstvalve.c @@ -37,6 +37,7 @@ #endif #include "gstvalve.h" +#include "gstcoreelementselements.h" #include @@ -100,6 +101,7 @@ static gboolean gst_valve_query (GstPad * pad, GstObject * parent, GST_DEBUG_CATEGORY_INIT (valve_debug, "valve", 0, "Valve"); #define gst_valve_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstValve, gst_valve, GST_TYPE_ELEMENT, _do_init); +GST_ELEMENT_REGISTER_DEFINE (valve, "valve", GST_RANK_NONE, GST_TYPE_VALVE); static void gst_valve_class_init (GstValveClass * klass) diff --git a/plugins/elements/meson.build b/plugins/elements/meson.build index c1d91d2f340..574ee87b85e 100644 --- a/plugins/elements/meson.build +++ b/plugins/elements/meson.build @@ -4,7 +4,7 @@ gst_elements_sources = [ 'gstconcat.c', 'gstdataurisrc.c', 'gstdownloadbuffer.c', - 'gstelements.c', + 'gstcoreelementsplugin.c', 'gstelements_private.c', 'gstfakesink.c', 'gstfakesrc.c', -- GitLab