mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
fdkaac: allow per feature registration
Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2038>
This commit is contained in:
parent
e2816f2b85
commit
c1b47c0780
7 changed files with 51 additions and 16 deletions
|
@ -231,18 +231,3 @@ const GstFdkAacChannelLayout channel_layouts[] = {
|
|||
{0, MODE_INVALID, {GST_AUDIO_CHANNEL_POSITION_INVALID}},
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
return gst_element_register (plugin, "fdkaacenc", GST_RANK_PRIMARY,
|
||||
GST_TYPE_FDKAACENC)
|
||||
&& gst_element_register (plugin, "fdkaacdec", GST_RANK_MARGINAL,
|
||||
GST_TYPE_FDKAACDEC);
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
fdkaac,
|
||||
"Fraunhofer FDK AAC Codec plugin",
|
||||
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
||||
|
|
|
@ -68,6 +68,8 @@ static GstFlowReturn gst_fdkaacdec_handle_frame (GstAudioDecoder * dec,
|
|||
static void gst_fdkaacdec_flush (GstAudioDecoder * dec, gboolean hard);
|
||||
|
||||
G_DEFINE_TYPE (GstFdkAacDec, gst_fdkaacdec, GST_TYPE_AUDIO_DECODER);
|
||||
GST_ELEMENT_REGISTER_DEFINE (fdkaacdec, "fdkaacdec", GST_RANK_MARGINAL,
|
||||
GST_TYPE_FDKAACDEC);
|
||||
|
||||
static gboolean
|
||||
gst_fdkaacdec_start (GstAudioDecoder * dec)
|
||||
|
|
|
@ -55,6 +55,8 @@ struct _GstFdkAacDecClass {
|
|||
|
||||
GType gst_fdkaacdec_get_type (void);
|
||||
|
||||
GST_ELEMENT_REGISTER_DECLARE (fdkaacdec);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_FDKAACDEC_H__ */
|
||||
|
|
|
@ -95,6 +95,8 @@ static GstCaps *gst_fdkaacenc_get_caps (GstAudioEncoder * enc,
|
|||
static void gst_fdkaacenc_flush (GstAudioEncoder * enc);
|
||||
|
||||
G_DEFINE_TYPE (GstFdkAacEnc, gst_fdkaacenc, GST_TYPE_AUDIO_ENCODER);
|
||||
GST_ELEMENT_REGISTER_DEFINE (fdkaacenc, "fdkaacenc", GST_RANK_PRIMARY,
|
||||
GST_TYPE_FDKAACENC);
|
||||
|
||||
static void
|
||||
gst_fdkaacenc_set_property (GObject * object, guint prop_id,
|
||||
|
|
|
@ -59,6 +59,8 @@ struct _GstFdkAacEncClass {
|
|||
|
||||
GType gst_fdkaacenc_get_type (void);
|
||||
|
||||
GST_ELEMENT_REGISTER_DECLARE (fdkaacenc);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_FDKAACENC_H__ */
|
||||
|
|
42
ext/fdkaac/gstfdkaacplugin.c
Normal file
42
ext/fdkaac/gstfdkaacplugin.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (C) 2016 Sebastian Dröge <sebastian@centricular.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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 "gstfdkaacdec.h"
|
||||
#include "gstfdkaacenc.h"
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
|
||||
ret |= GST_ELEMENT_REGISTER (fdkaacenc, plugin);
|
||||
ret |= GST_ELEMENT_REGISTER (fdkaacdec, plugin);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
fdkaac,
|
||||
"Fraunhofer FDK AAC Codec plugin",
|
||||
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
|
@ -14,7 +14,7 @@ if fdkaac_dep.found()
|
|||
endif
|
||||
|
||||
gstfdkaac = library('gstfdkaac',
|
||||
['gstfdkaac.c', 'gstfdkaacenc.c', 'gstfdkaacdec.c'],
|
||||
['gstfdkaac.c', 'gstfdkaacenc.c', 'gstfdkaacdec.c','gstfdkaacplugin.c'],
|
||||
c_args : gst_plugins_bad_args + fdkaac_defines,
|
||||
include_directories : [configinc],
|
||||
dependencies : [gstaudio_dep, gstpbutils_dep, fdkaac_dep],
|
||||
|
|
Loading…
Reference in a new issue