summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorDave Robillard <dave@drobilla.net>2009-08-12 01:03:32 -0400
committerDave Robillard <dave@drobilla.net>2009-08-12 01:03:32 -0400
commit47b7c2a9690bd34213cb1bc2d48851874af9d850 (patch)
treefd3d7bcc57b844810e7f0a84c2f4a2ef46ac9c59 /gst-libs/gst
parentd462b3b4e849d310fd7f203abf076e26b0d9bddc (diff)
downloadgst-plugins-bad-47b7c2a9690bd34213cb1bc2d48851874af9d850.tar.gz
gst-plugins-bad-47b7c2a9690bd34213cb1bc2d48851874af9d850.tar.bz2
gst-plugins-bad-47b7c2a9690bd34213cb1bc2d48851874af9d850.zip
Multi-channel support with channel positions.
This queries port roles from the LV2 data and converts it into GStreamer channel positions. This should allow any type of multi-channel plugin (including beyond stereo, e.g. surround) to work fine in GStreamer, and with elements that require channel positions to be explicitly stated.
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/signalprocessor/gstsignalprocessor.c8
-rw-r--r--gst-libs/gst/signalprocessor/gstsignalprocessor.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/gst-libs/gst/signalprocessor/gstsignalprocessor.c b/gst-libs/gst/signalprocessor/gstsignalprocessor.c
index 3d3c7204..4cf69e35 100644
--- a/gst-libs/gst/signalprocessor/gstsignalprocessor.c
+++ b/gst-libs/gst/signalprocessor/gstsignalprocessor.c
@@ -90,11 +90,14 @@ gst_signal_processor_pad_template_get_type (void)
* @name: pad name
* @direction: pad direction (src/sink)
* @index: index for the pad per direction (starting from 0)
+ * @channels: number of channels in this pad
+ * @positions: array of channel positions in order
*
*/
void
gst_signal_processor_class_add_pad_template (GstSignalProcessorClass * klass,
- const gchar * name, GstPadDirection direction, guint index, guint channels)
+ const gchar * name, GstPadDirection direction, guint index, guint channels,
+ const GstAudioChannelPosition * pos)
{
GstPadTemplate *new;
GstCaps *caps;
@@ -107,6 +110,9 @@ gst_signal_processor_class_add_pad_template (GstSignalProcessorClass * klass,
"endianness", G_TYPE_INT, G_BYTE_ORDER,
"width", G_TYPE_INT, 32, "channels", G_TYPE_INT, channels, NULL);
+ if (pos)
+ gst_audio_set_caps_channel_positions_list (caps, pos, channels);
+
new = g_object_new (gst_signal_processor_pad_template_get_type (),
"name", name, "name-template", name,
"direction", direction, "presence", GST_PAD_ALWAYS, "caps", caps, NULL);
diff --git a/gst-libs/gst/signalprocessor/gstsignalprocessor.h b/gst-libs/gst/signalprocessor/gstsignalprocessor.h
index 30ed0315..b7daf7e5 100644
--- a/gst-libs/gst/signalprocessor/gstsignalprocessor.h
+++ b/gst-libs/gst/signalprocessor/gstsignalprocessor.h
@@ -25,6 +25,7 @@
#define __GST_SIGNAL_PROCESSOR_H__
#include <gst/gst.h>
+#include <gst/audio/multichannel.h>
G_BEGIN_DECLS
@@ -131,7 +132,8 @@ struct _GstSignalProcessorClass {
GType gst_signal_processor_get_type (void);
void gst_signal_processor_class_add_pad_template (GstSignalProcessorClass *klass,
- const gchar *name, GstPadDirection direction, guint index, guint channels);
+ const gchar *name, GstPadDirection direction, guint index, guint channels,
+ const GstAudioChannelPosition *pos);