mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
gst/rtp/gstrtpchannels.*: Add method to get possible channel positions.
Original commit message from CVS: * gst/rtp/gstrtpchannels.c: (gst_rtp_channels_get_by_index): * gst/rtp/gstrtpchannels.h: Add method to get possible channel positions.
This commit is contained in:
parent
23f37b0179
commit
b29385bd76
3 changed files with 38 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-10-28 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/rtp/gstrtpchannels.c: (gst_rtp_channels_get_by_index):
|
||||||
|
* gst/rtp/gstrtpchannels.h:
|
||||||
|
Add method to get possible channel positions.
|
||||||
|
|
||||||
2008-10-28 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-10-28 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* gst/rtp/Makefile.am:
|
* gst/rtp/Makefile.am:
|
||||||
|
|
|
@ -110,6 +110,37 @@ gst_rtp_channels_get_by_order (gint channels, const gchar * order)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtp_channels_get_by_index:
|
||||||
|
* @channels: the amount of channels
|
||||||
|
* @idx: the channel index to retrieve
|
||||||
|
*
|
||||||
|
* Get the allowed channel order descriptions for @channels. @idx can be used to
|
||||||
|
* retrieve the desired index.
|
||||||
|
*
|
||||||
|
* Returns: a #GstRTPChannelOrder at @idx, NULL when there are no valid channel
|
||||||
|
* orders.
|
||||||
|
*/
|
||||||
|
const GstRTPChannelOrder *
|
||||||
|
gst_rtp_channels_get_by_index (gint channels, guint idx)
|
||||||
|
{
|
||||||
|
gint i;
|
||||||
|
const GstRTPChannelOrder *res = NULL;
|
||||||
|
|
||||||
|
for (i = 0; channel_orders[i].pos; i++) {
|
||||||
|
if (channel_orders[i].channels != channels)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (idx == 0) {
|
||||||
|
res = &channel_orders[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
idx--;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtp_channels_create_default:
|
* gst_rtp_channels_create_default:
|
||||||
* @channels: the amount of channels
|
* @channels: the amount of channels
|
||||||
|
|
|
@ -181,5 +181,6 @@ const GstRTPChannelOrder * gst_rtp_channels_get_by_pos (gint channels,
|
||||||
const GstAudioChannelPosition *pos);
|
const GstAudioChannelPosition *pos);
|
||||||
const GstRTPChannelOrder * gst_rtp_channels_get_by_order (gint channels,
|
const GstRTPChannelOrder * gst_rtp_channels_get_by_order (gint channels,
|
||||||
const gchar *order);
|
const gchar *order);
|
||||||
|
const GstRTPChannelOrder * gst_rtp_channels_get_by_index (gint channels, guint idx);
|
||||||
|
|
||||||
GstAudioChannelPosition * gst_rtp_channels_create_default (gint channels);
|
GstAudioChannelPosition * gst_rtp_channels_create_default (gint channels);
|
||||||
|
|
Loading…
Reference in a new issue