summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2007-01-31 08:16:59 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2007-01-31 08:16:59 +0000
commit75337844d926e80038f6d6d4f283c22a94ca5dd5 (patch)
treee4adee34a9a58f25ca42d6b45d2a426c42106e9f /ext
parent385bba644fffe6d585467a34ac8e01563263f4b5 (diff)
downloadgst-plugins-bad-75337844d926e80038f6d6d4f283c22a94ca5dd5.tar.gz
gst-plugins-bad-75337844d926e80038f6d6d4f283c22a94ca5dd5.tar.bz2
gst-plugins-bad-75337844d926e80038f6d6d4f283c22a94ca5dd5.zip
Fix classification in GstElementDetails.
Original commit message from CVS: * ext/alsaspdif/alsaspdifsink.c: * gst/nsf/gstnsf.c: Fix classification in GstElementDetails. * ext/ladspa/gstladspa.c: (gst_ladspa_base_init), (gst_ladspa_class_init): Improve Klassification and reduce code slighly.
Diffstat (limited to 'ext')
-rw-r--r--ext/alsaspdif/alsaspdifsink.c2
-rw-r--r--ext/ladspa/gstladspa.c83
2 files changed, 39 insertions, 46 deletions
diff --git a/ext/alsaspdif/alsaspdifsink.c b/ext/alsaspdif/alsaspdifsink.c
index 2a11e549..514e1c3d 100644
--- a/ext/alsaspdif/alsaspdifsink.c
+++ b/ext/alsaspdif/alsaspdifsink.c
@@ -71,7 +71,7 @@ GST_DEBUG_CATEGORY_STATIC (alsaspdifsink_debug);
/* ElementFactory information. */
static GstElementDetails alsaspdifsink_details = {
"S/PDIF ALSA audiosink",
- "audio/x-iec958",
+ "Sink/Audio",
"Feeds audio to S/PDIF interfaces through the ALSA sound driver",
"Martin Soto <martinsoto@users.sourceforge.net>\n"
"Michael Smith <msmith@fluendo.com>"
diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c
index 317c7fd3..a8f7a45e 100644
--- a/ext/ladspa/gstladspa.c
+++ b/ext/ladspa/gstladspa.c
@@ -69,7 +69,7 @@ gst_ladspa_base_init (gpointer g_class)
GstSignalProcessorClass *gsp_class = GST_SIGNAL_PROCESSOR_CLASS (g_class);
GstElementDetails *details;
LADSPA_Descriptor *desc;
- gint j, sinkcount, srccount;
+ guint j, audio_in_count, audio_out_count, control_in_count, control_out_count;
GST_DEBUG ("base_init %p", g_class);
@@ -84,7 +84,9 @@ gst_ladspa_base_init (gpointer g_class)
/* pad templates */
gsp_class->num_audio_in = 0;
gsp_class->num_audio_out = 0;
- /* control gets set in the class init */
+ /* properties */
+ gsp_class->num_control_in = 0;
+ gsp_class->num_control_out = 0;
for (j = 0; j < desc->PortCount; j++) {
LADSPA_PortDescriptor p = desc->PortDescriptors[j];
@@ -103,6 +105,11 @@ gst_ladspa_base_init (gpointer g_class)
else
gst_signal_processor_class_add_pad_template (gsp_class, name,
GST_PAD_SRC, gsp_class->num_audio_out++);
+ } else if (LADSPA_IS_PORT_CONTROL (p)) {
+ if (LADSPA_IS_PORT_INPUT (p))
+ gsp_class->num_control_in++;
+ else
+ gsp_class->num_control_out++;
}
}
@@ -115,27 +122,46 @@ gst_ladspa_base_init (gpointer g_class)
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
+ else if (gsp_class->num_audio_out == 0) {
+ if (gsp_class->num_control_out == 0)
+ details->klass = "Sink/Audio/LADSPA";
+ else
+ details->klass = "Sink/Analyzer/Audio/LADSPA";
+ } else
details->klass = "Filter/Effect/Audio/LADSPA";
gst_element_class_set_details (element_class, details);
klass->audio_in_portnums = g_new0 (gint, gsp_class->num_audio_in);
klass->audio_out_portnums = g_new0 (gint, gsp_class->num_audio_out);
+ klass->control_in_portnums = g_new0 (gint, gsp_class->num_control_in);
+ klass->control_out_portnums = g_new0 (gint, gsp_class->num_control_out);
+
+ audio_in_count = audio_out_count = control_in_count = control_out_count = 0;
- 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;
+ LADSPA_PortDescriptor p = desc->PortDescriptors[j];
+
+ if (LADSPA_IS_PORT_AUDIO (p)) {
+ if (LADSPA_IS_PORT_INPUT (p))
+ klass->audio_in_portnums[audio_in_count++] = j;
else
- klass->audio_out_portnums[srccount++] = j;
+ klass->audio_out_portnums[audio_out_count++] = j;
+ } else if (LADSPA_IS_PORT_CONTROL (p)) {
+ if (LADSPA_IS_PORT_INPUT (p))
+ klass->control_in_portnums[control_in_count++] = j;
+ else
+ klass->control_out_portnums[control_out_count++] = j;
}
}
+ g_assert (audio_in_count == gsp_class->num_audio_in);
+ g_assert (audio_out_count == gsp_class->num_audio_out);
+ g_assert (control_in_count == gsp_class->num_control_in);
+ g_assert (control_out_count == gsp_class->num_control_out);
+
if (!LADSPA_IS_INPLACE_BROKEN (desc->Properties))
GST_SIGNAL_PROCESSOR_CLASS_SET_CAN_PROCESS_IN_PLACE (klass);
@@ -291,8 +317,7 @@ gst_ladspa_class_init (GstLADSPAClass * klass)
{
GObjectClass *gobject_class;
GstSignalProcessorClass *gsp_class;
- LADSPA_Descriptor *desc;
- gint i, control_in_count, control_out_count;
+ gint i;
GST_DEBUG ("class_init %p", klass);
@@ -307,39 +332,7 @@ gst_ladspa_class_init (GstLADSPAClass * klass)
gsp_class->cleanup = gst_ladspa_cleanup;
gsp_class->process = gst_ladspa_process;
- desc = klass->descriptor;
- g_assert (desc);
-
- gsp_class->num_control_in = 0;
- gsp_class->num_control_out = 0;
-
- for (i = 0; i < desc->PortCount; i++) {
- LADSPA_PortDescriptor p = desc->PortDescriptors[i];
-
- if (!LADSPA_IS_PORT_AUDIO (p)) {
- if (LADSPA_IS_PORT_INPUT (p))
- gsp_class->num_control_in++;
- else
- gsp_class->num_control_out++;
- }
- }
-
- klass->control_in_portnums = g_new0 (gint, gsp_class->num_control_in);
- klass->control_out_portnums = g_new0 (gint, gsp_class->num_control_out);
-
- control_in_count = control_out_count = 0;
- for (i = 0; i < desc->PortCount; i++) {
- LADSPA_PortDescriptor p = desc->PortDescriptors[i];
-
- if (!LADSPA_IS_PORT_AUDIO (p)) {
- if (LADSPA_IS_PORT_INPUT (p))
- klass->control_in_portnums[control_in_count++] = i;
- else
- klass->control_out_portnums[control_out_count++] = i;
- }
- }
- g_assert (control_in_count == gsp_class->num_control_in);
- g_assert (control_out_count == gsp_class->num_control_out);
+ /* register properties */
for (i = 0; i < gsp_class->num_control_in; i++) {
GParamSpec *p;