From d7d11d074ff0ae9ccb38f347c89e737c103f3d19 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Mon, 26 May 2014 15:16:45 +0200 Subject: [PATCH] tools/avinfo: Decode MPEG-2,4 AAC codec capabilities --- tools/avinfo.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/tools/avinfo.c b/tools/avinfo.c index e7747db35..7e9dfd1a1 100644 --- a/tools/avinfo.c +++ b/tools/avinfo.c @@ -168,9 +168,57 @@ static void print_vendor(a2dp_vendor_codec_t *vendor) btohs(vendor->codec_id)); } -static void print_mpeg24(a2dp_mpeg_t *mpeg) +static void print_mpeg24(a2dp_aac_t *aac) { - printf("\tMedia Codec: MPEG24\n"); + unsigned freq = AAC_GET_FREQUENCY(*aac); + unsigned bitrate = AAC_GET_BITRATE(*aac); + + printf("\tMedia Codec: MPEG24\n\t\tObject Types: "); + + if (aac->object_type & AAC_OBJECT_TYPE_MPEG2_AAC_LC) + printf("MPEG-2 AAC LC "); + if (aac->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_LC) + printf("MPEG-4 AAC LC "); + if (aac->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_LTP) + printf("MPEG-4 AAC LTP "); + if (aac->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_SCA) + printf("MPEG-4 AAC scalable "); + + printf("\n\t\tFrequencies: "); + if (freq & AAC_SAMPLING_FREQ_8000) + printf("8kHz "); + if (freq & AAC_SAMPLING_FREQ_11025) + printf("11.025kHz "); + if (freq & AAC_SAMPLING_FREQ_12000) + printf("12kHz "); + if (freq & AAC_SAMPLING_FREQ_16000) + printf("16kHz "); + if (freq & AAC_SAMPLING_FREQ_22050) + printf("22.05kHz "); + if (freq & AAC_SAMPLING_FREQ_24000) + printf("24kHz "); + if (freq & AAC_SAMPLING_FREQ_32000) + printf("32kHz "); + if (freq & AAC_SAMPLING_FREQ_44100) + printf("44.1kHz "); + if (freq & AAC_SAMPLING_FREQ_48000) + printf("48kHz "); + if (freq & AAC_SAMPLING_FREQ_64000) + printf("64kHz "); + if (freq & AAC_SAMPLING_FREQ_88200) + printf("88.2kHz "); + if (freq & AAC_SAMPLING_FREQ_96000) + printf("96kHz "); + + printf("\n\t\tChannels: "); + if (aac->channels & AAC_CHANNELS_1) + printf("1 "); + if (aac->channels & AAC_CHANNELS_2) + printf("2 "); + + printf("\n\t\tBitrate: %u", bitrate); + + printf("\n\t\tVBR: %s", aac->vbr ? "Yes\n" : "No\n"); } static void print_mpeg12(a2dp_mpeg_t *mpeg) -- 2.47.3