<div dir="ltr"><div>Merged, thanks for contributing,<br><br></div><div>Kind regards,<br><br></div>Jean-Paul Saman</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 17, 2015 at 11:09 PM, Daniel Kamil Kozar <span dir="ltr"><<a href="mailto:dkk089@gmail.com" target="_blank">dkk089@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
examples/dvbinfo/libdvbpsi.c | 147 ++++++++++++++++++++++++-------------------<br>
1 file changed, 83 insertions(+), 64 deletions(-)<br>
<br>
diff --git a/examples/dvbinfo/libdvbpsi.c b/examples/dvbinfo/libdvbpsi.c<br>
index 714d143..e44294e 100644<br>
--- a/examples/dvbinfo/libdvbpsi.c<br>
+++ b/examples/dvbinfo/libdvbpsi.c<br>
@@ -1252,6 +1252,86 @@ static void DumpSubtitleDescriptor(const void *p_descriptor)<br>
}<br>
}<br>
<br>
+static const char *AACProfileToString(dvbpsi_aac_profile_and_level_t profile)<br>
+{<br>
+ switch(profile)<br>
+ {<br>
+ /* 0x00-0x0E Reserved */<br>
+ case DVBPSI_AAC_PROFILE_NOT_DEFINED:<br>
+ return "No audio profile and level defined for the associated MPEG-4 "<br>
+ "audio stream";<br>
+<br>
+ case DVBPSI_AAC_PROFILE_MAIN_LEVEL_1: return "Main profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_MAIN_LEVEL_2: return "Main profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_MAIN_LEVEL_3: return "Main profile, level 3";<br>
+ case DVBPSI_AAC_PROFILE_MAIN_LEVEL_4: return "Main profile, level 4";<br>
+ /* 0x14-0x17 Reserved */<br>
+ case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_1: return "Scalable Profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_2: return "Scalable Profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_3: return "Scalable Profile, level 3";<br>
+ case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_4: return "Scalable Profile, level 4";<br>
+ /* 0x1C-0x1F Reserved */<br>
+ case DVBPSI_AAC_PROFILE_SPEECH_LEVEL_1: return "Speech profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_SPEECH_LEVEL_2: return "Speech profile, level 2";<br>
+ /* 0x22-0x27 Reserved */<br>
+ case DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_1: return "Synthesis profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_2: return "Synthesis profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_3: return "Synthesis profile, level 3";<br>
+ /* 0x2B-0x2F Reserved */<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_1: return "High quality audio profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_2: return "High quality audio profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_3: return "High quality audio profile, level 3";<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_4: return "High quality audio profile, level 4";<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_5: return "High quality audio profile, level 5";<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_6: return "High quality audio profile, level 6";<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_7: return "High quality audio profile, level 7";<br>
+ case DVBPSI_AAC_PROFILE_HQ_LEVEL_8: return "High quality audio profile, level 8";<br>
+<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_1: return "Low delay audio profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_2: return "Low delay audio profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_3: return "Low delay audio profile, level 3";<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_4: return "Low delay audio profile, level 4";<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_5: return "Low delay audio profile, level 5";<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_6: return "Low delay audio profile, level 6";<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_7: return "Low delay audio profile, level 7";<br>
+ case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_8: return "Low delay audio profile, level 8";<br>
+<br>
+ case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_1: return "Natural audio profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_2: return "Natural audio profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_3: return "Natural audio profile, level 3";<br>
+ case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_4: return "Natural audio profile, level 4";<br>
+ /* 0x44-0x47 Reserved */<br>
+ case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_1: return "Mobile audio internetworking profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_2: return "Mobile audio internetworking profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_3: return "Mobile audio internetworking profile, level 3";<br>
+ case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_4: return "Mobile audio internetworking profile, level 4";<br>
+ case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_5: return "Mobile audio internetworking profile, level 5";<br>
+ case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_6: return "Mobile audio internetworking profile, level 6";<br>
+ /* 0x4E-0x4F Reserved */<br>
+ case DVBPSI_AAC_PROFILE_LEVEL_1: return "AAC profile, level 1";<br>
+ case DVBPSI_AAC_PROFILE_LEVEL_2: return "AAC profile, level 2";<br>
+ case DVBPSI_AAC_PROFILE_LEVEL_4: return "AAC profile, level 4";<br>
+ case DVBPSI_AAC_PROFILE_LEVEL_5: return "AAC profile, level 5";<br>
+ /* 0x54-0x57 RESERVED */<br>
+ case DVBPSI_HE_AAC_PROFILE_LEVEL_2: return "High efficiency AAC profile, level 2";<br>
+ case DVBPSI_HE_AAC_PROFILE_LEVEL_3: return "High efficiency AAC profile, level 3";<br>
+ case DVBPSI_HE_AAC_PROFILE_LEVEL_4: return "High efficiency AAC profile, level 4";<br>
+ case DVBPSI_HE_AAC_PROFILE_LEVEL_5: return "High efficiency AAC profile, level 5";<br>
+ /* 0x5C-0x5F RESERVED */<br>
+ case DVBPSI_HE_AAC_V2_PROFILE_LEVEL_2: return "High efficiency AAC v2 profile, level 2";<br>
+ case DVBPSI_HE_AAC_V2_PROFILE_LEVEL_3: return "High efficiency AAC v2 profile, level 3";<br>
+ case DVBPSI_HE_AAC_V2_PROFILE_LEVEL_4: return "High efficiency AAC v2 profile, level 4";<br>
+ case DVBPSI_HE_AAC_V2_PROFILE_LEVEL_5: return "High efficiency AAC v2 profile, level 5";<br>
+ /* 0x64-0xFE RESERVED */<br>
+ case DVBPSI_AAC_PROFILE_NOT_SPECIFIED:<br>
+ return "Audio profile and level not specified by the "<br>
+ "MPEG-4_audio_profile_and_level field in this descriptor";<br>
+ /* RESERVED */<br>
+ case DVBPSI_AAC_PROFILE_RESERVED:<br>
+ default: return "reserved";<br>
+ }<br>
+}<br>
+<br>
/*****************************************************************************<br>
* DumpAACDescriptor<br>
*****************************************************************************/<br>
@@ -1259,70 +1339,9 @@ static void DumpAACDescriptor(const void *p_descriptor)<br>
{<br>
const dvbpsi_aac_dr_t *p_aac_descriptor = p_descriptor;<br>
printf("AAC audio descriptor\n");<br>
- printf("\tprofile and level: ");<br>
- switch(p_aac_descriptor->i_profile_and_level)<br>
- {<br>
- /* 0x00-0x0F Reserved */<br>
- case DVBPSI_AAC_PROFILE_MAIN_LEVEL_1: printf("Main profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MAIN_LEVEL_2: printf("Main profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MAIN_LEVEL_3: printf("Main profile, level 3\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MAIN_LEVEL_4: printf("Main profile, level 4\n"); break;<br>
- /* 0x14-0x17 Reserved */<br>
- case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_1: printf("Scalable Profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_2: printf("Scalable Profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_3: printf("Scalable Profile, level 3\n"); break;<br>
- case DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_4: printf("Scalable Profile, level 4\n"); break;<br>
- /* 0x1C-0x1F Reserved */<br>
- case DVBPSI_AAC_PROFILE_SPEECH_LEVEL_1: printf("Speech profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_SPEECH_LEVEL_2: printf("Speech profile, level 2\n"); break;<br>
- /* 0x22-0x27 Reserved */<br>
- case DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_1: printf("Synthesis profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_2: printf("Synthesis profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_3: printf("Synthesis profile, level 3\n"); break;<br>
- /* 0x2B-0x2F Reserved */<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_1: printf("High quality audio profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_2: printf("High quality audio profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_3: printf("High quality audio profile, level 3\n"); break;<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_4: printf("High quality audio profile, level 4\n"); break;<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_5: printf("High quality audio profile, level 5\n"); break;<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_6: printf("High quality audio profile, level 6\n"); break;<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_7: printf("High quality audio profile, level 7\n"); break;<br>
- case DVBPSI_AAC_PROFILE_HQ_LEVEL_8: printf("High quality audio profile, level 8\n"); break;<br>
-<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_1: printf("Low delay audio profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_2: printf("Low delay audio profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_3: printf("Low delay audio profile, level 3\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_4: printf("Low delay audio profile, level 4\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_5: printf("Low delay audio profile, level 5\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_6: printf("Low delay audio profile, level 6\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_7: printf("Low delay audio profile, level 7\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_8: printf("Low delay audio profile, level 8\n"); break;<br>
-<br>
- case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_1: printf("Natural audio profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_2: printf("Natural audio profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_3: printf("Natural audio profile, level 3\n"); break;<br>
- case DVBPSI_AAC_PROFILE_NATURAL_LEVEL_4: printf("Natural audio profile, level 4\n"); break;<br>
- /* 0x44-0x47 Reserved */<br>
- case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_1: printf("Mobile audio internetworking profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_2: printf("Mobile audio internetworking profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_3: printf("Mobile audio internetworking profile, level 3\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_4: printf("Mobile audio internetworking profile, level 4\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_5: printf("Mobile audio internetworking profile, level 5\n"); break;<br>
- case DVBPSI_AAC_PROFILE_MOBILE_LEVEL_6: printf("Mobile audio internetworking profile, level 6\n"); break;<br>
- /* 0x4E-0x4F Reserved */<br>
- case DVBPSI_AAC_PROFILE_LEVEL_1: printf("AAC profile, level 1\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LEVEL_2: printf("AAC profile, level 2\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LEVEL_4: printf("AAC profile, level 4\n"); break;<br>
- case DVBPSI_AAC_PROFILE_LEVEL_5: printf("AAC profile, level 5\n"); break;<br>
- /* 0x54-0x57 RESERVED */<br>
- case DVBPSI_HE_AAC_PROFILE_LEVEL_2: printf("High efficiency AAC profile, level 2\n"); break;<br>
- case DVBPSI_HE_AAC_PROFILE_LEVEL_3: printf("High efficiency AAC profile, level 3\n"); break;<br>
- case DVBPSI_HE_AAC_PROFILE_LEVEL_4: printf("High efficiency AAC profile, level 4\n"); break;<br>
- case DVBPSI_HE_AAC_PROFILE_LEVEL_5: printf("High efficiency AAC profile, level 5\n"); break;<br>
- /* RESERVED */<br>
- case DVBPSI_AAC_PROFILE_RESERVED:<br>
- default: printf("reserved\n"); break;<br>
- }<br>
+ printf("\tprofile and level: %s (0x%02x)\n",<br>
+ AACProfileToString(p_aac_descriptor->i_profile_and_level),<br>
+ p_aac_descriptor->i_profile_and_level);<br>
<br>
if (p_aac_descriptor->b_type)<br>
{<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.3.3<br>
<br>
_______________________________________________<br>
libdvbpsi-devel mailing list<br>
<a href="mailto:libdvbpsi-devel@videolan.org">libdvbpsi-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/libdvbpsi-devel" target="_blank">https://mailman.videolan.org/listinfo/libdvbpsi-devel</a><br>
</font></span></blockquote></div><br></div>