From 47b7c2a9690bd34213cb1bc2d48851874af9d850 Mon Sep 17 00:00:00 2001 From: Dave Robillard Date: Wed, 12 Aug 2009 01:03:32 -0400 Subject: 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. --- gst-libs/gst/signalprocessor/gstsignalprocessor.c | 8 +++++++- gst-libs/gst/signalprocessor/gstsignalprocessor.h | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'gst-libs/gst/signalprocessor') 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 +#include 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); -- cgit v1.2.1