Commit 891be511 authored by Stéphane Cerveau's avatar Stéphane Cerveau Committed by GStreamer Marge Bot
Browse files

gst-plugins: allow per feature registration

Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

gst-build!199
gstreamer!661

Part-of: <!2110>
parent 7f60138e
Pipeline #299091 waiting for manual action with stages
in 45 seconds
......@@ -72,8 +72,6 @@ enum
PROP_LAST_TRACK
};
#define parent_class gst_accurip_parent_class
G_DEFINE_TYPE (GstAccurip, gst_accurip, GST_TYPE_AUDIO_FILTER);
......@@ -86,6 +84,11 @@ static GstFlowReturn gst_accurip_transform_ip (GstBaseTransform * trans,
GstBuffer * buf);
static gboolean gst_accurip_sink_event (GstBaseTransform * trans,
GstEvent * event);
static gboolean accurip_element_init (GstPlugin * plugin);
#define parent_class gst_accurip_parent_class
G_DEFINE_TYPE (GstAccurip, gst_accurip, GST_TYPE_AUDIO_FILTER);
GST_ELEMENT_REGISTER_DEFINE_CUSTOM (accurip, accurip_element_init);
static void
gst_accurip_class_init (GstAccuripClass * klass)
......@@ -342,7 +345,7 @@ gst_accurip_get_property (GObject * object, guint prop_id,
}
static gboolean
plugin_init (GstPlugin * plugin)
accurip_element_init (GstPlugin * plugin)
{
gboolean ret;
......@@ -362,6 +365,12 @@ plugin_init (GstPlugin * plugin)
return ret;
}
static gboolean
plugin_init (GstPlugin * plugin)
{
return GST_ELEMENT_REGISTER (accurip, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
accurip,
......
......@@ -80,6 +80,8 @@ struct _GstAccuripClass
GType gst_accurip_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (accurip);
G_END_DECLS
#endif /* __GST_ACCURIP_H__ */
......@@ -81,7 +81,12 @@ typedef struct _ADPCMDec
} ADPCMDec;
GType adpcmdec_get_type (void);
G_DEFINE_TYPE (ADPCMDec, adpcmdec, GST_TYPE_AUDIO_DECODER);
GST_ELEMENT_REGISTER_DECLARE (adpcmdec);
G_DEFINE_TYPE_WITH_CODE (ADPCMDec, adpcmdec, GST_TYPE_AUDIO_DECODER,
GST_DEBUG_CATEGORY_INIT (adpcmdec_debug, "adpcmdec", 0, "ADPCM Decoders");
);
GST_ELEMENT_REGISTER_DEFINE (adpcmdec, "adpcmdec", GST_RANK_PRIMARY,
GST_TYPE_ADPCM_DEC);
static gboolean
adpcmdec_set_format (GstAudioDecoder * bdec, GstCaps * in_caps)
......@@ -485,12 +490,7 @@ adpcmdec_class_init (ADPCMDecClass * klass)
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (adpcmdec_debug, "adpcmdec", 0, "ADPCM Decoders");
if (!gst_element_register (plugin, "adpcmdec", GST_RANK_PRIMARY,
GST_TYPE_ADPCM_DEC)) {
return FALSE;
}
return TRUE;
return GST_ELEMENT_REGISTER (adpcmdec, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, adpcmdec,
......
......@@ -132,7 +132,12 @@ typedef struct _ADPCMEnc
} ADPCMEnc;
GType adpcmenc_get_type (void);
G_DEFINE_TYPE (ADPCMEnc, adpcmenc, GST_TYPE_AUDIO_ENCODER);
GST_ELEMENT_REGISTER_DECLARE (adpcmenc);
G_DEFINE_TYPE_WITH_CODE (ADPCMEnc, adpcmenc, GST_TYPE_AUDIO_ENCODER,
GST_DEBUG_CATEGORY_INIT (adpcmenc_debug, "adpcmenc", 0, "ADPCM Encoders");
);
GST_ELEMENT_REGISTER_DEFINE (adpcmenc, "adpcmenc", GST_RANK_PRIMARY,
GST_TYPE_ADPCM_ENC);
static gboolean
adpcmenc_setup (ADPCMEnc * enc)
......@@ -470,12 +475,7 @@ adpcmenc_class_init (ADPCMEncClass * klass)
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (adpcmenc_debug, "adpcmenc", 0, "ADPCM Encoders");
if (!gst_element_register (plugin, "adpcmenc", GST_RANK_PRIMARY,
GST_TYPE_ADPCM_ENC)) {
return FALSE;
}
return TRUE;
return GST_ELEMENT_REGISTER (adpcmenc, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, adpcmenc,
......
......@@ -22,41 +22,16 @@
#include "config.h"
#endif
#include <gst/tag/tag.h>
#include "aiffelements.h"
#include <gst/gst-i18n-plugin.h>
#include "aiffparse.h"
#include "aiffmux.h"
GST_DEBUG_CATEGORY_STATIC (aiff_debug);
#define GST_CAT_DEFAULT (aiff_debug)
GST_DEBUG_CATEGORY_EXTERN (aiffparse_debug);
GST_DEBUG_CATEGORY_EXTERN (aiffmux_debug);
static gboolean
plugin_init (GstPlugin * plugin)
{
gboolean ret;
GST_DEBUG_CATEGORY_INIT (aiff_debug, "aiff", 0, "AIFF plugin");
GST_DEBUG_CATEGORY_INIT (aiffparse_debug, "aiffparse", 0, "AIFF parser");
GST_DEBUG_CATEGORY_INIT (aiffmux_debug, "aiffmux", 0, "AIFF muxer");
#ifdef ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
ret = gst_element_register (plugin, "aiffparse", GST_RANK_PRIMARY,
GST_TYPE_AIFF_PARSE);
ret &= gst_element_register (plugin, "aiffmux", GST_RANK_PRIMARY,
GST_TYPE_AIFF_MUX);
gboolean ret = FALSE;
gst_tag_register_musicbrainz_tags ();
ret |= GST_ELEMENT_REGISTER (aiffparse, plugin);
ret |= GST_ELEMENT_REGISTER (aiffmux, plugin);
return ret;
}
......
/* GStreamer
* 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_AIFF_ELEMENTS_H__
#define __GST_AIFF_ELEMENTS_H__
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gst/gst.h>
G_GNUC_INTERNAL void aiff_element_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (aiffmux);
GST_ELEMENT_REGISTER_DECLARE (aiffparse);
#endif /* __GST_AIFF_ELEMENTS_H__ */
......@@ -57,6 +57,7 @@
#include <gst/gst.h>
#include <gst/base/gstbytewriter.h>
#include "aiffelements.h"
#include "aiffmux.h"
GST_DEBUG_CATEGORY (aiffmux_debug);
......@@ -77,7 +78,10 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
);
#define gst_aiff_mux_parent_class parent_class
G_DEFINE_TYPE (GstAiffMux, gst_aiff_mux, GST_TYPE_ELEMENT);
G_DEFINE_TYPE_WITH_CODE (GstAiffMux, gst_aiff_mux, GST_TYPE_ELEMENT,
GST_DEBUG_CATEGORY_INIT (aiffmux_debug, "aiffmux", 0, "AIFF muxer"));
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (aiffmux, "aiffmux", GST_RANK_PRIMARY,
GST_TYPE_AIFF_MUX, aiff_element_init (plugin));
static GstStateChangeReturn
gst_aiff_mux_change_state (GstElement * element, GstStateChange transition)
......
......@@ -52,6 +52,7 @@
#include <string.h>
#include <math.h>
#include "aiffelements.h"
#include "aiffparse.h"
#include <gst/audio/audio.h>
#include <gst/tag/tag.h>
......@@ -104,7 +105,10 @@ GST_STATIC_PAD_TEMPLATE ("src",
#define MAX_BUFFER_SIZE 4096
#define gst_aiff_parse_parent_class parent_class
G_DEFINE_TYPE (GstAiffParse, gst_aiff_parse, GST_TYPE_ELEMENT);
G_DEFINE_TYPE_WITH_CODE (GstAiffParse, gst_aiff_parse, GST_TYPE_ELEMENT,
GST_DEBUG_CATEGORY_INIT (aiffparse_debug, "aiffparse", 0, "AIFF parser"));
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (aiffparse, "aiffparse", GST_RANK_PRIMARY,
GST_TYPE_AIFF_PARSE, aiff_element_init (plugin));
static void
gst_aiff_parse_class_init (GstAiffParseClass * klass)
......
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
/* GStreamer AIFF plugin initialisation
* Copyright (C) <2008> Pioneers of the Inevitable <songbird@songbirdnest.com>
*
* 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 <gst/tag/tag.h>
#include <gst/gst-i18n-plugin.h>
#include "aiffelements.h"
GST_DEBUG_CATEGORY_STATIC (aiff_debug);
#define GST_CAT_DEFAULT (aiff_debug)
void
aiff_element_init (GstPlugin * plugin)
{
static gsize res = FALSE;
if (g_once_init_enter (&res)) {
GST_DEBUG_CATEGORY_INIT (aiff_debug, "aiff", 0, "AIFF plugin");
#ifdef ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
gst_tag_register_musicbrainz_tags ();
g_once_init_leave (&res, TRUE);
}
}
aiff_sources = [
'aiff.c', 'aiffmux.c', 'aiffparse.c',
'aiff.c', 'aiffmux.c', 'aiffparse.c', 'gstaiffelement.c'
]
gstaiff = library('gstaiff',
......
......@@ -32,16 +32,13 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_asf_mux_plugin_init (plugin)) {
return FALSE;
}
if (!gst_rtp_asf_pay_plugin_init (plugin)) {
return FALSE;
}
if (!gst_asf_parse_plugin_init (plugin)) {
return FALSE;
}
return TRUE;
gboolean ret = FALSE;
ret |= GST_ELEMENT_REGISTER (asfmux, plugin);
ret |= GST_ELEMENT_REGISTER (rtpasfpay, plugin);
ret |= GST_ELEMENT_REGISTER (asfparse, plugin);
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
......
......@@ -173,6 +173,8 @@ static GstElementClass *parent_class = NULL;
G_DEFINE_TYPE_WITH_CODE (GstAsfMux, gst_asf_mux, GST_TYPE_ELEMENT,
G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL));
GST_ELEMENT_REGISTER_DEFINE (asfmux, "asfmux",
GST_RANK_PRIMARY, GST_TYPE_ASF_MUX);
static void
gst_asf_mux_reset (GstAsfMux * asfmux)
......@@ -2455,10 +2457,3 @@ gst_asf_mux_change_state (GstElement * element, GstStateChange transition)
done:
return ret;
}
gboolean
gst_asf_mux_plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "asfmux",
GST_RANK_PRIMARY, GST_TYPE_ASF_MUX);
}
......@@ -152,7 +152,7 @@ struct _GstAsfMuxClass
};
GType gst_asf_mux_get_type (void);
gboolean gst_asf_mux_plugin_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (asfmux);
G_END_DECLS
#endif /* __GST_ASF_MUX_H__ */
......@@ -44,6 +44,8 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
#define gst_asf_parse_parent_class parent_class
G_DEFINE_TYPE (GstAsfParse, gst_asf_parse, GST_TYPE_BASE_PARSE);
GST_ELEMENT_REGISTER_DEFINE (asfparse, "asfparse",
GST_RANK_NONE, GST_TYPE_ASF_PARSE);
static gboolean
gst_asf_parse_start (GstBaseParse * parse)
......@@ -416,10 +418,3 @@ gst_asf_parse_init (GstAsfParse * asfparse)
asfparse->asfinfo = gst_asf_file_info_new ();
asfparse->packetinfo = g_new0 (GstAsfPacketInfo, 1);
}
gboolean
gst_asf_parse_plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "asfparse",
GST_RANK_NONE, GST_TYPE_ASF_PARSE);
}
......@@ -71,7 +71,7 @@ struct _GstAsfParseClass {
};
GType gst_asf_parse_get_type(void);
gboolean gst_asf_parse_plugin_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (asfparse);
G_END_DECLS
......
......@@ -57,6 +57,8 @@ gst_rtp_asf_pay_set_caps (GstRTPBasePayload * rtppay, GstCaps * caps);
#define gst_rtp_asf_pay_parent_class parent_class
G_DEFINE_TYPE (GstRtpAsfPay, gst_rtp_asf_pay, GST_TYPE_RTP_BASE_PAYLOAD);
GST_ELEMENT_REGISTER_DEFINE (rtpasfpay, "rtpasfpay",
GST_RANK_NONE, GST_TYPE_RTP_ASF_PAY);
static void
gst_rtp_asf_pay_init (GstRtpAsfPay * rtpasfpay)
......@@ -460,10 +462,3 @@ gst_rtp_asf_pay_handle_buffer (GstRTPBasePayload * rtppay, GstBuffer * buffer)
gst_buffer_unref (buffer);
return GST_FLOW_OK;
}
gboolean
gst_rtp_asf_pay_plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "rtpasfpay",
GST_RANK_NONE, GST_TYPE_RTP_ASF_PAY);
}
......@@ -81,7 +81,8 @@ struct _GstRtpAsfPayClass
};
GType gst_rtp_asf_pay_get_type (void);
gboolean gst_rtp_asf_pay_plugin_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (rtpasfpay);
G_END_DECLS
#endif /* __GST_RTP_ASF_PAY_H__ */
......@@ -63,7 +63,11 @@ enum
#define DEFAULT_MAX_SILENCE_TIME (0)
#define parent_class gst_audio_buffer_split_parent_class
G_DEFINE_TYPE (GstAudioBufferSplit, gst_audio_buffer_split, GST_TYPE_ELEMENT);
G_DEFINE_TYPE_WITH_CODE (GstAudioBufferSplit, gst_audio_buffer_split,
GST_TYPE_ELEMENT, GST_DEBUG_CATEGORY_INIT (gst_audio_buffer_split_debug,
"audiobuffersplit", 0, "Audio buffer splitter"););
GST_ELEMENT_REGISTER_DEFINE (audiobuffersplit, "audiobuffersplit",
GST_RANK_NONE, GST_TYPE_AUDIO_BUFFER_SPLIT);
static GstFlowReturn gst_audio_buffer_split_sink_chain (GstPad * pad,
GstObject * parent, GstBuffer * buffer);
......@@ -923,13 +927,7 @@ gst_audio_buffer_split_src_query (GstPad * pad,
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_audio_buffer_split_debug, "audiobuffersplit",
0, "Audio buffer splitter");
gst_element_register (plugin, "audiobuffersplit", GST_RANK_NONE,
GST_TYPE_AUDIO_BUFFER_SPLIT);
return TRUE;
return GST_ELEMENT_REGISTER (audiobuffersplit, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
......
......@@ -74,6 +74,7 @@ struct _GstAudioBufferSplitClass {
};
GType gst_audio_buffer_split_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (audiobuffersplit);
G_END_DECLS
......
......@@ -91,6 +91,8 @@ G_DEFINE_TYPE_WITH_CODE (GstAudioChannelMix, gst_audio_channel_mix,
GST_TYPE_AUDIO_FILTER,
GST_DEBUG_CATEGORY_INIT (gst_audio_channel_mix_debug_category,
"audiochannelmix", 0, "debug category for audiochannelmix element"));
GST_ELEMENT_REGISTER_DEFINE (audiochannelmix, "audiochannelmix", GST_RANK_NONE,
GST_TYPE_AUDIO_CHANNEL_MIX);
static void
gst_audio_channel_mix_class_init (GstAudioChannelMixClass * klass)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment