opus: add some more debug information about channel mapping
This commit is contained in:
parent
605d407b16
commit
287a0c646e
@ -70,3 +70,19 @@ const GstAudioChannelPosition gst_opus_channel_positions[][8] = {
|
|||||||
GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
|
GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
|
||||||
GST_AUDIO_CHANNEL_POSITION_LFE},
|
GST_AUDIO_CHANNEL_POSITION_LFE},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char *gst_opus_channel_names[] = {
|
||||||
|
"mono",
|
||||||
|
"front left",
|
||||||
|
"front right",
|
||||||
|
"rear center",
|
||||||
|
"rear left",
|
||||||
|
"rear right",
|
||||||
|
"lfe",
|
||||||
|
"front center",
|
||||||
|
"front left of center",
|
||||||
|
"front right of center",
|
||||||
|
"side left",
|
||||||
|
"side right",
|
||||||
|
"none"
|
||||||
|
};
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
extern const GstAudioChannelPosition gst_opus_channel_positions[][8];
|
extern const GstAudioChannelPosition gst_opus_channel_positions[][8];
|
||||||
|
extern const char *gst_opus_channel_names[];
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -294,6 +294,7 @@ gst_opus_dec_parse_header (GstOpusDec * dec, GstBuffer * buf)
|
|||||||
dec->sample_rate);
|
dec->sample_rate);
|
||||||
|
|
||||||
if (pos) {
|
if (pos) {
|
||||||
|
GST_DEBUG_OBJECT (dec, "Setting channel positions on caps");
|
||||||
gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos);
|
gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,7 +466,8 @@ gst_opus_enc_setup_channel_mapping (GstOpusEnc * enc, const GstAudioInfo * info)
|
|||||||
GstAudioChannelPosition pos = GST_AUDIO_INFO_POSITION (info, n);
|
GstAudioChannelPosition pos = GST_AUDIO_INFO_POSITION (info, n);
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (enc, "Channel %d has position %d", n, pos);
|
GST_DEBUG_OBJECT (enc, "Channel %d has position %d (%s)", n, pos,
|
||||||
|
gst_opus_channel_names[pos]);
|
||||||
for (c = 0; c < enc->n_channels; ++c) {
|
for (c = 0; c < enc->n_channels; ++c) {
|
||||||
if (gst_opus_channel_positions[enc->n_channels - 1][c] == pos) {
|
if (gst_opus_channel_positions[enc->n_channels - 1][c] == pos) {
|
||||||
GST_DEBUG_OBJECT (enc, "Found in Vorbis mapping as channel %d", c);
|
GST_DEBUG_OBJECT (enc, "Found in Vorbis mapping as channel %d", c);
|
||||||
@ -476,12 +477,13 @@ gst_opus_enc_setup_channel_mapping (GstOpusEnc * enc, const GstAudioInfo * info)
|
|||||||
if (c == enc->n_channels) {
|
if (c == enc->n_channels) {
|
||||||
/* We did not find that position, so use undefined */
|
/* We did not find that position, so use undefined */
|
||||||
GST_WARNING_OBJECT (enc,
|
GST_WARNING_OBJECT (enc,
|
||||||
"Position %d not found in Vorbis mapping, using unknown mapping",
|
"Position %d (%s) not found in Vorbis mapping, using unknown mapping",
|
||||||
pos);
|
pos, gst_opus_channel_positions[pos]);
|
||||||
enc->channel_mapping_family = 255;
|
enc->channel_mapping_family = 255;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GST_DEBUG_OBJECT (enc, "Mapping output channel %d to %d", c, n);
|
GST_DEBUG_OBJECT (enc, "Mapping output channel %d to %d (%s)", c, n,
|
||||||
|
gst_opus_channel_names[pos]);
|
||||||
enc->channel_mapping[c] = n;
|
enc->channel_mapping[c] = n;
|
||||||
}
|
}
|
||||||
GST_INFO_OBJECT (enc, "Permutation found, using Vorbis mapping");
|
GST_INFO_OBJECT (enc, "Permutation found, using Vorbis mapping");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user