diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2011-11-25 12:47:42 +0000 |
---|---|---|
committer | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2011-11-25 15:31:59 +0000 |
commit | 65079e3adaa34831202bed7e650f4f0cb47ec3ff (patch) | |
tree | 119dc75397ac891ee317cd76b9d47cdc35fed010 /ext | |
parent | 2e0e11867634d513a448cdf5d07984cf81e0a0ed (diff) | |
download | gstreamer-plugins-bad-65079e3adaa34831202bed7e650f4f0cb47ec3ff.tar.gz |
opus: add some more debug information about channel mapping
Diffstat (limited to 'ext')
-rw-r--r-- | ext/opus/gstopuscommon.c | 16 | ||||
-rw-r--r-- | ext/opus/gstopuscommon.h | 1 | ||||
-rw-r--r-- | ext/opus/gstopusdec.c | 1 | ||||
-rw-r--r-- | ext/opus/gstopusenc.c | 10 |
4 files changed, 24 insertions, 4 deletions
diff --git a/ext/opus/gstopuscommon.c b/ext/opus/gstopuscommon.c index fc3e0376b..426c5b897 100644 --- a/ext/opus/gstopuscommon.c +++ b/ext/opus/gstopuscommon.c @@ -70,3 +70,19 @@ const GstAudioChannelPosition gst_opus_channel_positions[][8] = { GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, 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" +}; diff --git a/ext/opus/gstopuscommon.h b/ext/opus/gstopuscommon.h index 96a303e30..65b944e9e 100644 --- a/ext/opus/gstopuscommon.h +++ b/ext/opus/gstopuscommon.h @@ -27,6 +27,7 @@ G_BEGIN_DECLS extern const GstAudioChannelPosition gst_opus_channel_positions[][8]; +extern const char *gst_opus_channel_names[]; G_END_DECLS diff --git a/ext/opus/gstopusdec.c b/ext/opus/gstopusdec.c index cc1bdb2a1..ee1886040 100644 --- a/ext/opus/gstopusdec.c +++ b/ext/opus/gstopusdec.c @@ -294,6 +294,7 @@ gst_opus_dec_parse_header (GstOpusDec * dec, GstBuffer * buf) dec->sample_rate); if (pos) { + GST_DEBUG_OBJECT (dec, "Setting channel positions on caps"); gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos); } diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index 11ddcc127..a926bbdb4 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -466,7 +466,8 @@ gst_opus_enc_setup_channel_mapping (GstOpusEnc * enc, const GstAudioInfo * info) GstAudioChannelPosition pos = GST_AUDIO_INFO_POSITION (info, n); 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) { if (gst_opus_channel_positions[enc->n_channels - 1][c] == pos) { 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) { /* We did not find that position, so use undefined */ GST_WARNING_OBJECT (enc, - "Position %d not found in Vorbis mapping, using unknown mapping", - pos); + "Position %d (%s) not found in Vorbis mapping, using unknown mapping", + pos, gst_opus_channel_positions[pos]); enc->channel_mapping_family = 255; 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; } GST_INFO_OBJECT (enc, "Permutation found, using Vorbis mapping"); |