[0.11] gst-plugins-base: audio: expose API to convert channel array to a mask

Wim Taymans wtay at kemper.freedesktop.org
Thu Jan 5 04:59:53 PST 2012


Module: gst-plugins-base
Branch: 0.11
Commit: dd43d0697ed8b53de3a5449db54af208ac324f1c
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=dd43d0697ed8b53de3a5449db54af208ac324f1c

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Jan  5 13:59:32 2012 +0100

audio: expose API to convert channel array to a mask

---

 gst-libs/gst/audio/audio.c |   17 +++++++++++++++++
 gst-libs/gst/audio/audio.h |    3 +++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/gst-libs/gst/audio/audio.c b/gst-libs/gst/audio/audio.c
index 0eaed7c..c51d9c9 100644
--- a/gst-libs/gst/audio/audio.c
+++ b/gst-libs/gst/audio/audio.c
@@ -1085,6 +1085,23 @@ gst_audio_check_valid_channel_positions (const GstAudioChannelPosition *
 }
 
 /**
+ * gst_audio_channel_positions_to_mask:
+ * @position: The %GstAudioChannelPositions
+ * @channels: The number of channels.
+ * @channel_mask: the output channel mask
+ *
+ * Convert the @position array of @channels channels to a bitmask.
+ *
+ * Returns: %TRUE if the channel positions are valid and could be converted.
+ */
+gboolean
+gst_audio_channel_positions_to_mask (const GstAudioChannelPosition * position,
+    gint channels, guint64 * channel_mask)
+{
+  return check_valid_channel_positions (position, channels, TRUE, channel_mask);
+}
+
+/**
  * gst_audio_get_channel_reorder_map:
  * @channels: The number of channels.
  * @from: The channel positions to reorder from.
diff --git a/gst-libs/gst/audio/audio.h b/gst-libs/gst/audio/audio.h
index dac40fc..f1a3d11 100644
--- a/gst-libs/gst/audio/audio.h
+++ b/gst-libs/gst/audio/audio.h
@@ -553,6 +553,9 @@ gboolean       gst_audio_channel_positions_to_valid_order (GstAudioChannelPositi
 gboolean       gst_audio_check_valid_channel_positions (const GstAudioChannelPosition *position,
                                                         gint channels, gboolean force_order);
 
+gboolean       gst_audio_channel_positions_to_mask  (const GstAudioChannelPosition *position,
+                                                     gint channels, guint64 *channel_mask);
+
 gboolean       gst_audio_get_channel_reorder_map (gint channels,
                                                   const GstAudioChannelPosition * from,
                                                   const GstAudioChannelPosition * to,



More information about the gstreamer-commits mailing list