diff --git a/gst/gstdeviceprovider.h b/gst/gstdeviceprovider.h index cafe37e1cacc2798bfaa2d74ed5e8b579d6a255f..ba8c5210cf6c47424df256af3604018d7b8c2a56 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/gst/gstdynamictypefactory.h b/gst/gstdynamictypefactory.h index c8ac3c675f96fddac69fe5bc48b1b74f43fde759..95b60181ce75492b5edc59c425fabb5add181b64 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: * diff --git a/gst/gstelement.h b/gst/gstelement.h index c1bfb45f2adc22195cfa240ad5081d0a0af9f252..f550a27656737299b30599ad3c442c3c8b21a30c 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; diff --git a/gst/gsttypefind.h b/gst/gsttypefind.h index 1c7f12b21039bc8cef3fd33908a2e1ef7e42e2e5..bcd336f15236c575c171b48f95582a41c95dd8b1 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()) diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c index 79128d7272b52de6cb85aa38594460a07d1c4950..438f6e1f040454efe7fd4a0ec6b2eea91cfd6bd8 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 807c84265f9fa202e5fbfccb3b4b9f1a40ca8989..4d5d3e2544fcc3d5f0bcff5c7bea57698901167d 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 049554605a5721daa6829fa72eb04bb2d73c6d87..659edea8ae0ad07db46aa017b42ddeaa31e4e2c2 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 0000000000000000000000000000000000000000..fa930aafe7b02084aa4d879cdb74c952029457f1 --- /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 0000000000000000000000000000000000000000..82ea0d54a4276f7f52094c55b6fda52baf65a3ff --- /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 8129cb3207501180cbc76b9d77090b0ae5cb9cd7..a6132b53be8f746263c5c1e62a1fd9b6b0c96b90 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 5e11133e8ba56333c6f064d43d36778199d3d1b4..4dc96f1131d7cc488e7e5656762161436dbb0623 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 5ed328c2a5f1b3163dde4d4ef9b2f6b5b876af4e..0000000000000000000000000000000000000000 --- 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 05acdc95b15c9401009dc0a37cff649c53d80bc9..028c87adfbaff5656ce3a35d9f70f656d04f6bab 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 6a6ad46fc6ef562a8ed56e7a595d8956ff3f3436..24c27661789f39ab8fa004bc4c148ee2d18bfe3a 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 5cf34883418fcfe304993c1b20c46d456b7ccac6..ad69ec088234bc948af6555fa7fa20dc5cf02fb1 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 77017e2775531fd4a9826941de722898bfd26a6c..f88d38e36af7baec9e8f99952ea308cffc46b484 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 29bb9de902cdd33b2ee2dce364a66d8e420ab118..1caa2373a5531876c94c811f1f3d0a611026da4e 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 a31eb32fc2608c4a005e030d53f59f2e2f8be56f..bcd58d8c6a01c330d224f14039e42fd8ce9ff853 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 8827f492c9ae452c39bcb7afaa6f72b98bf1acf8..cdb22c905e35c51cc5ce394fc9da91b9d65c7ad0 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 af477649d6d3bef24065a10d8f9c74e696e511d4..74b9f737f871740aed29836c1fcc7f8e489262a1 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 107f3205f0a07b16c9dd8d7ad7f452c72b616f39..4d509e2f2b64c476b1ed5637c30278ea73708a3b 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 98d27aa75e463e867d56f44082228e08d3289f3e..e0f2ab066d51be5dab8b0bf27726af29d75ab388 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 d3270a6f85aac2ff5acf8698fa02babb42ce0013..1a1a3fb908391a66f7992252ebd8bbc426182a20 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 972676254147343802a90a77b9f86338b3224990..e381083a87a5cba2a48406686164caeadeff86cb 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 cb230b31ad2676f2b458d5d017549f57440f58e0..e61caaebff44e9ba30b6abd475bc7becf7804ac5 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 f0b1dd29b508a876b10118fde797c21eacc9b11a..fdc5636dfbad82fcb9a2ad0d0042e0b2fcc22dc4 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 ab5183e103ed0144cefaa58ddd8a96c27d5a62e3..dd90c38671496d0cf4abe747c60be5454debd295 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 2259bd428e49f01a74334058f7cd098a135419c2..fb14df69b37257351a4a5fc51164445b9ec54eeb 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 f8f9682e490f9365166c9e20184c4097231fe14a..bbb3527739c9b9b6185b7b2e630465975229ac3e 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 c1d91d2f3406e40c4bd50ce07d76904b391406b9..574ee87b85e19a9af31738fb137b52038ef31b30 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', diff --git a/tests/check/gst/gstdevice.c b/tests/check/gst/gstdevice.c index 8d47236080801449ea1d54d0bf6030a1b4a99b0f..0c4d91f12e353398debfa174211a27b2ab3711f2 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);