Top |
#define GST_AUDIO_CHANNEL_POSITION_MASK(pos) (G_GUINT64_CONSTANT(1)<< GST_AUDIO_CHANNEL_POSITION_ ## pos)
gboolean gst_audio_channel_positions_to_mask (const GstAudioChannelPosition *position
,gint channels
,gboolean force_order
,guint64 *channel_mask
);
Convert the position
array of channels
channels to a bitmask.
If force_order
is TRUE
it additionally checks if the channels are
in the order required by GStreamer.
gboolean gst_audio_channel_positions_from_mask (gint channels
,guint64 channel_mask
,GstAudioChannelPosition *position
);
Convert the channels
present in channel_mask
to a position
array
(which should have at least channels
entries ensured by caller).
If channel_mask
is set to 0, it is considered as 'not present' for purpose
of conversion.
channels |
The number of channels |
|
channel_mask |
The input channel_mask |
|
position |
The
|
[array length=channels] |
gboolean gst_audio_channel_positions_to_valid_order (GstAudioChannelPosition *position
,gint channels
);
Reorders the channel positions in position
from any order to
the GStreamer channel order.
gboolean gst_audio_check_valid_channel_positions (const GstAudioChannelPosition *position
,gint channels
,gboolean force_order
);
Checks if position
contains valid channel positions for
channels
channels. If force_order
is TRUE
it additionally
checks if the channels are in the order required by GStreamer.
position |
The |
[array length=channels] |
channels |
The number of channels. |
|
force_order |
Only consider the GStreamer channel order. |
gboolean gst_audio_buffer_reorder_channels (GstBuffer *buffer
,GstAudioFormat format
,gint channels
,const GstAudioChannelPosition *from
,const GstAudioChannelPosition *to
);
Reorders buffer
from the channel positions from
to the channel
positions to
. from
and to
must contain the same number of
positions and the same positions, only in a different order.
buffer
must be writable.
buffer |
The buffer to reorder. |
|
format |
The |
|
channels |
The number of channels. |
|
from |
The channel positions in the buffer. |
[array] |
to |
The channel positions to convert to. |
[array] |
gboolean gst_audio_reorder_channels (gpointer data
,gsize size
,GstAudioFormat format
,gint channels
,const GstAudioChannelPosition *from
,const GstAudioChannelPosition *to
);
Reorders data
from the channel positions from
to the channel
positions to
. from
and to
must contain the same number of
positions and the same positions, only in a different order.
data |
The pointer to the memory. |
[array length=size][element-type guint8] |
size |
The size of the memory. |
|
format |
The |
|
channels |
The number of channels. |
|
from |
The channel positions in the buffer. |
[array] |
to |
The channel positions to convert to. |
[array] |
gboolean gst_audio_get_channel_reorder_map (gint channels
,const GstAudioChannelPosition *from
,const GstAudioChannelPosition *to
,gint *reorder_map
);
Returns a reorder map for from
to to
that can be used in
custom channel reordering code, e.g. to convert from or to the
GStreamer channel order. from
and to
must contain the same
number of positions and the same positions, only in a
different order.
The resulting reorder_map
can be used for reordering by assigning
channel i of the input to channel reorder_map[i] of the output.
Audio channel positions.
These are the channels defined in SMPTE 2036-2-2008 Table 1 for 22.2 audio systems with the Surround and Wide channels from DTS Coherent Acoustics (v.1.3.1) and 10.2 and 7.1 layouts. In the caps the actual channel layout is expressed with a channel count and a channel mask, which describes the existing channels. The positions in the bit mask correspond to the enum values. For negotiation it is allowed to have more bits set in the channel mask than the number of channels to specify the allowed channel positions but this is not allowed in negotiated caps. It is not allowed in any situation other than the one mentioned below to have less bits set in the channel mask than the number of channels.
GST_AUDIO_CHANNEL_POSITION_MONO
can only be used with a single mono channel that
has no direction information and would be mixed into all directional channels.
This is expressed in caps by having a single channel and no channel mask.
GST_AUDIO_CHANNEL_POSITION_NONE
can only be used if all channels have this position.
This is expressed in caps by having a channel mask with no bits set.
As another special case it is allowed to have two channels without a channel mask. This implicitely means that this is a stereo stream with a front left and front right channel.
used for position-less channels, e.g. from a sound card that records 1024 channels; mutually exclusive with any other channel position |
||
Mono without direction; can only be used with 1 channel |
||
invalid position |
||
Front left |
||
Front right |
||
Front center |
||
Low-frequency effects 1 (subwoofer) |
||
Rear left |
||
Rear right |
||
Front left of center |
||
Front right of center |
||
Rear center |
||
Low-frequency effects 2 (subwoofer) |
||
Side left |
||
Side right |
||
Top front left |
||
Top front right |
||
Top front center |
||
Top center |
||
Top rear left |
||
Top rear right |
||
Top side right |
||
Top rear right |
||
Top rear center |
||
Bottom front center |
||
Bottom front left |
||
Bottom front right |
||
Wide left (between front left and side left) |
||
Wide right (between front right and side right) |
||
Surround left (between rear left and side left) |
||
Surround right (between rear right and side right) |