mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
ext/ladspa/gstladspa.*: Halfway-ported. Doesn't compile yet.
Original commit message from CVS: 2005-08-25 Andy Wingo <wingo@pobox.com> * ext/ladspa/gstladspa.h: * ext/ladspa/gstladspa.c: Halfway-ported. Doesn't compile yet. * ext/ladspa/gstsignalprocessor.h: * ext/ladspa/gstsignalprocessor.c: New files, the start of a base class for DSP elements. * configure.ac: Sort the external libs checks, add a ladspa check, output the ladspa makefile.
This commit is contained in:
parent
776f95cc79
commit
0f4381d9a2
6 changed files with 181 additions and 144 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2005-08-25 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* ext/ladspa/gstladspa.h:
|
||||||
|
* ext/ladspa/gstladspa.c: Halfway-ported. Doesn't compile yet.
|
||||||
|
|
||||||
|
* ext/ladspa/gstsignalprocessor.h:
|
||||||
|
* ext/ladspa/gstsignalprocessor.c: New files, the start of a base
|
||||||
|
class for DSP elements.
|
||||||
|
|
||||||
|
* configure.ac: Sort the external libs checks, add a ladspa check,
|
||||||
|
output the ladspa makefile.
|
||||||
|
|
||||||
2005-08-25 Owen Fraser-Green <owen@discobabe.net>
|
2005-08-25 Owen Fraser-Green <owen@discobabe.net>
|
||||||
|
|
||||||
* gst/realmedia/rmdemux.c (gst_rmdemux_loop, gst_rmdemux_chain):
|
* gst/realmedia/rmdemux.c (gst_rmdemux_loop, gst_rmdemux_chain):
|
||||||
|
|
115
configure.ac
115
configure.ac
|
@ -379,6 +379,19 @@ GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnbdec amrnbenc, [
|
||||||
AC_SUBST(AMRNB_LIBS))
|
AC_SUBST(AMRNB_LIBS))
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl **** ESound ****
|
||||||
|
translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
|
||||||
|
GST_CHECK_FEATURE(ESD, [esound plug-ins], esdsink, [
|
||||||
|
PKG_CHECK_MODULES(ESD, esound >= 0.2.12, [
|
||||||
|
HAVE_ESD="yes"
|
||||||
|
AC_SUBST(ESD_CFLAGS)
|
||||||
|
AC_SUBST(ESD_LIBS)
|
||||||
|
], [
|
||||||
|
AM_PATH_ESD(0.2.12, HAVE_ESD="yes", HAVE_ESD="no")
|
||||||
|
AS_SCRUB_INCLUDE(ESD_CFLAGS)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
dnl **** Free AAC Decoder (FAAD) ****
|
dnl **** Free AAC Decoder (FAAD) ****
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_FAAD, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_FAAD, true)
|
||||||
GST_CHECK_FEATURE(FAAD, [AAC decoder plug-in], faad, [
|
GST_CHECK_FEATURE(FAAD, [AAC decoder plug-in], faad, [
|
||||||
|
@ -426,6 +439,33 @@ GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
|
||||||
AC_SUBST(FLAC_LIBS)
|
AC_SUBST(FLAC_LIBS)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl *** jpeg ***
|
||||||
|
dnl FIXME: we could use header checks here as well IMO
|
||||||
|
translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
|
||||||
|
GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
|
||||||
|
AC_ARG_WITH(jpeg-mmx,
|
||||||
|
[ --with-jpeg-mmx, path to MMX'ified JPEG library])
|
||||||
|
OLD_LIBS="$LIBS"
|
||||||
|
if test x$with_jpeg_mmx != x; then
|
||||||
|
LIBS="$LIBS -L$with_jpeg_mmx"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
|
||||||
|
JPEG_LIBS="$LIBS -ljpeg-mmx"
|
||||||
|
LIBS="$OLD_LIBS"
|
||||||
|
if test x$HAVE_JPEG != xyes; then
|
||||||
|
AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
|
||||||
|
JPEG_LIBS="-ljpeg"
|
||||||
|
fi
|
||||||
|
AC_SUBST(JPEG_LIBS)
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
dnl *** ladspa ***
|
||||||
|
translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
|
||||||
|
GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
|
||||||
|
AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
|
||||||
|
])
|
||||||
|
|
||||||
dnl *** lame ***
|
dnl *** lame ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
|
||||||
GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
|
GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
|
||||||
|
@ -467,46 +507,13 @@ GST_CHECK_FEATURE(LIBDV, [libdv DV/video decoder], dvdec, [
|
||||||
AC_SUBST(LIBDV_LIBS)
|
AC_SUBST(LIBDV_LIBS)
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl *** shout2 ***
|
dnl *** libpng ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
|
||||||
GST_CHECK_FEATURE(SHOUT2, [shout2 plug-in], shout2send, [
|
GST_CHECK_FEATURE(LIBPNG, [libpng PNG encoder], pngenc, [
|
||||||
PKG_CHECK_MODULES(SHOUT2, shout >= 2.0, [
|
PKG_CHECK_MODULES(LIBPNG, libpng12, HAVE_LIBPNG="yes", HAVE_LIBPNG="no")
|
||||||
HAVE_SHOUT2="yes"
|
AC_SUBST(LIBPNG_CFLAGS)
|
||||||
AC_SUBST(SHOUT2_CFLAGS)
|
AC_SUBST(LIBPNG_LIBS)
|
||||||
AC_SUBST(SHOUT2_LIBS)
|
|
||||||
], [
|
|
||||||
AM_PATH_SHOUT2(HAVE_SHOUT2="yes", HAVE_SHOUT2="no")
|
|
||||||
AC_SUBST(SHOUT2_CFLAGS)
|
|
||||||
AC_SUBST(SHOUT2_LIBS)
|
|
||||||
])
|
])
|
||||||
])
|
|
||||||
|
|
||||||
dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
|
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
|
|
||||||
GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
|
|
||||||
GST_PATH_SIDPLAY()
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl *** jpeg ***
|
|
||||||
dnl FIXME: we could use header checks here as well IMO
|
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
|
|
||||||
GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
|
|
||||||
AC_ARG_WITH(jpeg-mmx,
|
|
||||||
[ --with-jpeg-mmx, path to MMX'ified JPEG library])
|
|
||||||
OLD_LIBS="$LIBS"
|
|
||||||
if test x$with_jpeg_mmx != x; then
|
|
||||||
LIBS="$LIBS -L$with_jpeg_mmx"
|
|
||||||
fi
|
|
||||||
AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
|
|
||||||
JPEG_LIBS="$LIBS -ljpeg-mmx"
|
|
||||||
LIBS="$OLD_LIBS"
|
|
||||||
if test x$HAVE_JPEG != xyes; then
|
|
||||||
AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
|
|
||||||
JPEG_LIBS="-ljpeg"
|
|
||||||
fi
|
|
||||||
AC_SUBST(JPEG_LIBS)
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
dnl *** mad ***
|
dnl *** mad ***
|
||||||
dnl FIXME: we could use header checks here as well IMO
|
dnl FIXME: we could use header checks here as well IMO
|
||||||
|
@ -563,25 +570,24 @@ GST_CHECK_FEATURE(DV1394, [raw1394 and avc1394 library], dv1394src, [
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl **** ESound ****
|
dnl *** shout2 ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
|
||||||
GST_CHECK_FEATURE(ESD, [esound plug-ins], esdsink, [
|
GST_CHECK_FEATURE(SHOUT2, [shout2 plug-in], shout2send, [
|
||||||
PKG_CHECK_MODULES(ESD, esound >= 0.2.12, [
|
PKG_CHECK_MODULES(SHOUT2, shout >= 2.0, [
|
||||||
HAVE_ESD="yes"
|
HAVE_SHOUT2="yes"
|
||||||
AC_SUBST(ESD_CFLAGS)
|
AC_SUBST(SHOUT2_CFLAGS)
|
||||||
AC_SUBST(ESD_LIBS)
|
AC_SUBST(SHOUT2_LIBS)
|
||||||
], [
|
], [
|
||||||
AM_PATH_ESD(0.2.12, HAVE_ESD="yes", HAVE_ESD="no")
|
AM_PATH_SHOUT2(HAVE_SHOUT2="yes", HAVE_SHOUT2="no")
|
||||||
AS_SCRUB_INCLUDE(ESD_CFLAGS)
|
AC_SUBST(SHOUT2_CFLAGS)
|
||||||
|
AC_SUBST(SHOUT2_LIBS)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl *** libpng ***
|
dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
|
||||||
GST_CHECK_FEATURE(LIBPNG, [libpng PNG encoder], pngenc, [
|
GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
|
||||||
PKG_CHECK_MODULES(LIBPNG, libpng12, HAVE_LIBPNG="yes", HAVE_LIBPNG="no")
|
GST_PATH_SIDPLAY()
|
||||||
AC_SUBST(LIBPNG_CFLAGS)
|
|
||||||
AC_SUBST(LIBPNG_LIBS)
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl *** speex >= 1.0.4 or >= 1.1.5 ***
|
dnl *** speex >= 1.0.4 or >= 1.1.5 ***
|
||||||
|
@ -713,6 +719,7 @@ ext/aalib/Makefile
|
||||||
ext/dv/Makefile
|
ext/dv/Makefile
|
||||||
ext/flac/Makefile
|
ext/flac/Makefile
|
||||||
ext/gconf/Makefile
|
ext/gconf/Makefile
|
||||||
|
ext/ladspa/Makefile
|
||||||
ext/lame/Makefile
|
ext/lame/Makefile
|
||||||
ext/libcaca/Makefile
|
ext/libcaca/Makefile
|
||||||
ext/libpng/Makefile
|
ext/libpng/Makefile
|
||||||
|
|
|
@ -440,20 +440,21 @@ SUBDIRS=\
|
||||||
$(XVID_DIR)
|
$(XVID_DIR)
|
||||||
|
|
||||||
DIST_SUBDIRS=\
|
DIST_SUBDIRS=\
|
||||||
mad \
|
|
||||||
gconf \
|
|
||||||
shout2 \
|
|
||||||
sidplay \
|
|
||||||
aalib \
|
aalib \
|
||||||
libcaca \
|
|
||||||
esd \
|
|
||||||
raw1394 \
|
|
||||||
dv \
|
|
||||||
amrnb \
|
amrnb \
|
||||||
|
esd \
|
||||||
|
dv \
|
||||||
faad \
|
faad \
|
||||||
flac \
|
flac \
|
||||||
mpeg2dec \
|
gconf \
|
||||||
jpeg \
|
jpeg \
|
||||||
libpng \
|
ladspa \
|
||||||
lame \
|
lame \
|
||||||
|
libcaca \
|
||||||
|
libpng \
|
||||||
|
mad \
|
||||||
|
mpeg2dec \
|
||||||
|
raw1394 \
|
||||||
|
shout2 \
|
||||||
|
sidplay \
|
||||||
speex
|
speex
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
plugin_LTLIBRARIES = libgstladspa.la
|
plugin_LTLIBRARIES = libgstladspa.la
|
||||||
|
|
||||||
libgstladspa_la_SOURCES = gstladspa.c search.c load.c
|
libgstladspa_la_SOURCES = gstsignalprocessor.c gstladspa.c search.c load.c
|
||||||
libgstladspa_la_CFLAGS = $(GST_CFLAGS)
|
libgstladspa_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
|
||||||
libgstladspa_la_LIBADD = $(GST_LIBS)
|
libgstladspa_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-@GST_MAJORMINOR@
|
||||||
libgstladspa_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstladspa_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
||||||
noinst_HEADERS = gstladspa.h utils.h
|
noinst_HEADERS = gstsignalprocessor.h gstladspa.h utils.h
|
||||||
|
|
|
@ -36,50 +36,34 @@
|
||||||
#define LADSPA_VERSION "1.0"
|
#define LADSPA_VERSION "1.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static GstStaticCaps ladspa_pad_caps =
|
GST_BOILERPLATE (GstLADSPA, GST_TYPE_LADSPA, GstSignalProcessor,
|
||||||
GST_STATIC_CAPS (GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS);
|
GST_TYPE_SIGNAL_PROCESSOR);
|
||||||
|
|
||||||
static void gst_ladspa_class_init (GstLADSPAClass * klass);
|
|
||||||
static void gst_ladspa_base_init (GstLADSPAClass * klass);
|
|
||||||
static void gst_ladspa_init (GstLADSPA * ladspa);
|
|
||||||
|
|
||||||
static void gst_ladspa_update_int (const GValue * value, gpointer data);
|
|
||||||
static GstPadLinkReturn gst_ladspa_link (GstPad * pad, const GstCaps * caps);
|
|
||||||
|
|
||||||
static void gst_ladspa_set_property (GObject * object, guint prop_id,
|
static void gst_ladspa_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_ladspa_get_property (GObject * object, guint prop_id,
|
static void gst_ladspa_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
|
|
||||||
static gboolean gst_ladspa_instantiate (GstLADSPA * ladspa);
|
static gboolean gst_ladspa_setup (GstSignalProcessor * sigproc,
|
||||||
static void gst_ladspa_activate (GstLADSPA * ladspa);
|
guint sample_rate, guint buffer_frames);
|
||||||
static void gst_ladspa_deactivate (GstLADSPA * ladspa);
|
static gboolean gst_ladspa_activate (GstSignalProcessor * sigproc);
|
||||||
|
static gboolean gst_ladspa_deactivate (GstSignalProcessor * sigproc);
|
||||||
|
static gboolean gst_ladspa_process (GstSignalProcessor * sigproc);
|
||||||
|
|
||||||
static GstElementStateReturn gst_ladspa_change_state (GstElement * element);
|
|
||||||
static void gst_ladspa_loop (GstElement * element);
|
|
||||||
static void gst_ladspa_chain (GstPad * pad, GstData * _data);
|
|
||||||
static GstData *gst_ladspa_get (GstPad * pad);
|
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
|
||||||
|
|
||||||
static GstPlugin *ladspa_plugin;
|
static GstPlugin *ladspa_plugin;
|
||||||
static GHashTable *ladspa_descriptors;
|
static GHashTable *ladspa_descriptors;
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
ARG_0,
|
|
||||||
ARG_SAMPLERATE,
|
|
||||||
ARG_BUFFERSIZE,
|
|
||||||
ARG_LAST
|
|
||||||
};
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (ladspa_debug);
|
GST_DEBUG_CATEGORY_STATIC (ladspa_debug);
|
||||||
#define GST_CAT_DEFAULT ladspa_debug
|
#define GST_CAT_DEFAULT ladspa_debug
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ladspa_base_init (GstLADSPAClass * klass)
|
gst_ladspa_base_init (GstLADSPAClass * klass)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||||
|
GstSignalProcessorClass *gsp_class = GST_SIGNAL_PROCESSOR_CLASS (klass);
|
||||||
GstPadTemplate *templ;
|
GstPadTemplate *templ;
|
||||||
GstElementDetails *details;
|
GstElementDetails *details;
|
||||||
LADSPA_Descriptor *desc;
|
LADSPA_Descriptor *desc;
|
||||||
|
@ -92,27 +76,24 @@ gst_ladspa_base_init (GstLADSPAClass * klass)
|
||||||
g_assert (desc);
|
g_assert (desc);
|
||||||
|
|
||||||
/* pad templates */
|
/* pad templates */
|
||||||
klass->numports = desc->PortCount;
|
gsp_class->num_audio_in = 0;
|
||||||
klass->numsinkpads = 0;
|
gsp_class->num_audio_out = 0;
|
||||||
klass->numsrcpads = 0;
|
/* control gets set in the class init */
|
||||||
|
|
||||||
for (j = 0; j < desc->PortCount; j++) {
|
for (j = 0; j < desc->PortCount; j++) {
|
||||||
if (LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[j])) {
|
LADSPA_PortDescriptor p = desc->PortDescriptors[j];
|
||||||
|
|
||||||
|
if (LADSPA_IS_PORT_AUDIO (p)) {
|
||||||
gchar *name = g_strdup ((gchar *) desc->PortNames[j]);
|
gchar *name = g_strdup ((gchar *) desc->PortNames[j]);
|
||||||
|
|
||||||
g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
|
g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
|
||||||
|
|
||||||
/* the factories take ownership of the name */
|
if (LADSPA_IS_PORT_INPUT (p))
|
||||||
if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[j])) {
|
gst_signal_processor_class_add_pad_template (name, GST_PAD_SINK,
|
||||||
templ = gst_pad_template_new (name, GST_PAD_SINK, GST_PAD_ALWAYS,
|
gsp_class->num_audio_in++);
|
||||||
gst_caps_copy (gst_static_caps_get (&ladspa_pad_caps)));
|
else
|
||||||
klass->numsinkpads++;
|
gst_signal_processor_class_add_pad_template (name, GST_PAD_SRC,
|
||||||
} else {
|
gsp_class->num_audio_out++);
|
||||||
templ = gst_pad_template_new (name, GST_PAD_SRC, GST_PAD_ALWAYS,
|
|
||||||
gst_caps_copy (gst_static_caps_get (&ladspa_pad_caps)));
|
|
||||||
klass->numsrcpads++;
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class, templ);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,28 +106,24 @@ gst_ladspa_base_init (GstLADSPAClass * klass)
|
||||||
details->author = g_locale_to_utf8 (desc->Maker, -1, NULL, NULL, NULL);
|
details->author = g_locale_to_utf8 (desc->Maker, -1, NULL, NULL, NULL);
|
||||||
if (!details->author)
|
if (!details->author)
|
||||||
details->author = g_strdup ("no author available");
|
details->author = g_strdup ("no author available");
|
||||||
if ((klass->numsinkpads > 0) && (klass->numsrcpads > 0))
|
if (gsp_class->num_audio_in == 0)
|
||||||
details->klass = "Filter/Effect/Audio/LADSPA";
|
|
||||||
else if ((klass->numsinkpads == 0) && (klass->numsrcpads > 0))
|
|
||||||
details->klass = "Source/Audio/LADSPA";
|
details->klass = "Source/Audio/LADSPA";
|
||||||
else if ((klass->numsinkpads > 0) && (klass->numsrcpads == 0))
|
else if (gsp_class->num_audio_out == 0)
|
||||||
details->klass = "Sink/Audio/LADSPA";
|
details->klass = "Sink/Audio/LADSPA";
|
||||||
else
|
else
|
||||||
details->klass = "Filter/Effect/Audio/LADSPA"; /* whatever this is */
|
details->klass = "Filter/Effect/Audio/LADSPA";
|
||||||
gst_element_class_set_details (element_class, details);
|
gst_element_class_set_details (element_class, details);
|
||||||
|
|
||||||
klass->srcpad_portnums = g_new0 (gint, klass->numsrcpads);
|
klass->audio_in_portnums = g_new0 (gint, klass->num_audio_in);
|
||||||
klass->sinkpad_portnums = g_new0 (gint, klass->numsinkpads);
|
klass->audio_out_portnums = g_new0 (gint, gsp_class->num_audio_out);
|
||||||
sinkcount = 0;
|
|
||||||
srccount = 0;
|
|
||||||
|
|
||||||
/* walk through the ports, note the portnums for srcpads, sinkpads */
|
sinkcount = srccount = 0;
|
||||||
for (j = 0; j < desc->PortCount; j++) {
|
for (j = 0; j < desc->PortCount; j++) {
|
||||||
if (LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[j])) {
|
if (LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[j])) {
|
||||||
if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[j]))
|
if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[j]))
|
||||||
klass->sinkpad_portnums[sinkcount++] = j;
|
klass->audio_in_portnums[sinkcount++] = j;
|
||||||
else
|
else
|
||||||
klass->srcpad_portnums[srccount++] = j;
|
klass->audio_out_portnums[srccount++] = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +135,7 @@ gst_ladspa_class_init (GstLADSPAClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
|
GstSignalProcessorClass *gsp_class = GST_SIGNAL_PROCESSOR_CLASS (klass);
|
||||||
LADSPA_Descriptor *desc;
|
LADSPA_Descriptor *desc;
|
||||||
gint i, current_portnum, controlcount;
|
gint i, current_portnum, controlcount;
|
||||||
gint hintdesc;
|
gint hintdesc;
|
||||||
|
@ -173,6 +151,58 @@ gst_ladspa_class_init (GstLADSPAClass * klass)
|
||||||
|
|
||||||
gstelement_class->change_state = gst_ladspa_change_state;
|
gstelement_class->change_state = gst_ladspa_change_state;
|
||||||
|
|
||||||
|
gsp_class->num_control_in = 0;
|
||||||
|
gsp_class->num_control_in = 0;
|
||||||
|
|
||||||
|
for (j = 0; j < desc->PortCount; j++) {
|
||||||
|
LADSPA_PortDescriptor p = desc->PortDescriptors[j];
|
||||||
|
|
||||||
|
if (LADSPA_IS_PORT_AUDIO (p)) {
|
||||||
|
gchar *name = g_strdup ((gchar *) desc->PortNames[j]);
|
||||||
|
|
||||||
|
g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
|
||||||
|
|
||||||
|
if (LADSPA_IS_PORT_INPUT (p))
|
||||||
|
gst_signal_processor_class_add_pad_template (name, GST_PAD_SINK,
|
||||||
|
gsp_class->num_audio_in++);
|
||||||
|
else
|
||||||
|
gst_signal_processor_class_add_pad_template (name, GST_PAD_SRC,
|
||||||
|
gsp_class->num_audio_out++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* construct the element details struct */
|
||||||
|
details = g_new0 (GstElementDetails, 1);
|
||||||
|
details->longname = g_locale_to_utf8 (desc->Name, -1, NULL, NULL, NULL);
|
||||||
|
if (!details->longname)
|
||||||
|
details->longname = g_strdup ("no description available");
|
||||||
|
details->description = details->longname;
|
||||||
|
details->author = g_locale_to_utf8 (desc->Maker, -1, NULL, NULL, NULL);
|
||||||
|
if (!details->author)
|
||||||
|
details->author = g_strdup ("no author available");
|
||||||
|
if (gsp_class->num_audio_in == 0)
|
||||||
|
details->klass = "Source/Audio/LADSPA";
|
||||||
|
else if (gsp_class->num_audio_out == 0)
|
||||||
|
details->klass = "Sink/Audio/LADSPA";
|
||||||
|
else
|
||||||
|
details->klass = "Filter/Effect/Audio/LADSPA";
|
||||||
|
gst_element_class_set_details (element_class, details);
|
||||||
|
|
||||||
|
klass->audio_in_portnums = g_new0 (gint, klass->num_audio_in);
|
||||||
|
klass->audio_out_portnums = g_new0 (gint, gsp_class->num_audio_out);
|
||||||
|
|
||||||
|
sinkcount = srccount = 0;
|
||||||
|
for (j = 0; j < desc->PortCount; j++) {
|
||||||
|
if (LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[j])) {
|
||||||
|
if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[j]))
|
||||||
|
klass->audio_in_portnums[sinkcount++] = j;
|
||||||
|
else
|
||||||
|
klass->audio_out_portnums[srccount++] = j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
klass->descriptor = desc;
|
||||||
|
|
||||||
/* look up and store the ladspa descriptor */
|
/* look up and store the ladspa descriptor */
|
||||||
desc = g_hash_table_lookup (ladspa_descriptors,
|
desc = g_hash_table_lookup (ladspa_descriptors,
|
||||||
GINT_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
|
GINT_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
|
||||||
|
|
|
@ -24,15 +24,15 @@
|
||||||
#define __GST_LADSPA_H__
|
#define __GST_LADSPA_H__
|
||||||
|
|
||||||
|
|
||||||
|
#include <ladspa.h>
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/bytestream/bytestream.h>
|
|
||||||
|
|
||||||
#include "ladspa.h"
|
#include "gstsignalprocessor.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
G_BEGIN_DECLS
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
typedef struct _ladspa_control_info {
|
typedef struct _ladspa_control_info {
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -43,37 +43,26 @@ typedef struct _ladspa_control_info {
|
||||||
gboolean toggled, logarithmic, integer, writable;
|
gboolean toggled, logarithmic, integer, writable;
|
||||||
} ladspa_control_info;
|
} ladspa_control_info;
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GstLADSPA GstLADSPA;
|
typedef struct _GstLADSPA GstLADSPA;
|
||||||
typedef struct _GstLADSPAClass GstLADSPAClass;
|
typedef struct _GstLADSPAClass GstLADSPAClass;
|
||||||
|
|
||||||
|
|
||||||
struct _GstLADSPA {
|
struct _GstLADSPA {
|
||||||
GstElement element;
|
GstSignalProcessor parent;
|
||||||
|
|
||||||
LADSPA_Descriptor *descriptor;
|
LADSPA_Descriptor *descriptor;
|
||||||
LADSPA_Handle *handle;
|
LADSPA_Handle *handle;
|
||||||
|
|
||||||
gfloat *controls;
|
|
||||||
|
|
||||||
GstPad **sinkpads,
|
|
||||||
**srcpads;
|
|
||||||
|
|
||||||
gboolean activated;
|
gboolean activated;
|
||||||
|
|
||||||
gint samplerate, buffer_frames;
|
|
||||||
gint64 timestamp;
|
|
||||||
gboolean inplace_broken;
|
gboolean inplace_broken;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstLADSPAClass {
|
struct _GstLADSPAClass {
|
||||||
GstElementClass parent_class;
|
GstSignalProcessorClass parent_class;
|
||||||
|
|
||||||
LADSPA_Descriptor *descriptor;
|
LADSPA_Descriptor *descriptor;
|
||||||
|
|
||||||
gint numports,
|
|
||||||
numsinkpads,
|
|
||||||
numsrcpads,
|
|
||||||
numcontrols;
|
|
||||||
|
|
||||||
gint *sinkpad_portnums,
|
gint *sinkpad_portnums,
|
||||||
*srcpad_portnums,
|
*srcpad_portnums,
|
||||||
*control_portnums;
|
*control_portnums;
|
||||||
|
@ -82,9 +71,7 @@ struct _GstLADSPAClass {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
G_END_DECLS
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GST_LADSPA_H__ */
|
#endif /* __GST_LADSPA_H__ */
|
||||||
|
|
Loading…
Reference in a new issue