AAC ADTS
:http://blog.csdn.net/jay100500/article/details/52955232
aac
/**
*
* Simplest MediaData Test
*
* Lei Xiaohua
* [email protected]
* /
* Communication University of China / Digital TV Technology
* http://blog.csdn.net/leixiaohua1020
*
* :
* (1) 。 RGB YUV 。
* (2) 。 PCM 。
* (3)H.264 。 NALU。
* (4)AAC 。 ADTS 。
* (5)FLV 。 FLV MP3 。
* (6)UDP-RTP 。 UDP/RTP/MPEG-TS 。
*
* This project contains following samples to handling multimedia data:
* (1) Video pixel data handling program. It contains several examples to handle RGB and YUV data.
* (2) Audio sample data handling program. It contains several examples to handle PCM data.
* (3) H.264 stream analysis program. It can parse H.264 bitstream and analysis NALU of stream.
* (4) AAC stream analysis program. It can parse AAC bitstream and analysis ADTS frame of stream.
* (5) FLV format analysis program. It can analysis FLV file and extract MP3 audio stream.
* (6) UDP-RTP protocol analysis program. It can analysis UDP/RTP/MPEG-TS Packet.
*
*/
#include
#include
#include
int getADTSframe(unsigned char* buffer, int buf_size, unsigned char* data ,int* data_size)
{
int size = 0;
if(!buffer || !data || !data_size )
{
return -1;
}
while(1)
{
if(buf_size >5); //low 3bit
break;
}
--buf_size;
++buffer;
}
if(buf_size >6;
switch(profile){
case 0: sprintf(profile_str,"Main");break;
case 1: sprintf(profile_str,"LC");break;
case 2: sprintf(profile_str,"×××");break;
default:sprintf(profile_str,"unknown");break;
}
unsigned char sampling_frequency_index=aacframe[2]&0x3C;
sampling_frequency_index=sampling_frequency_index>>2;
switch(sampling_frequency_index){
case 0: sprintf(frequence_str,"96000Hz");break;
case 1: sprintf(frequence_str,"88200Hz");break;
case 2: sprintf(frequence_str,"64000Hz");break;
case 3: sprintf(frequence_str,"48000Hz");break;
case 4: sprintf(frequence_str,"44100Hz");break;
case 5: sprintf(frequence_str,"32000Hz");break;
case 6: sprintf(frequence_str,"24000Hz");break;
case 7: sprintf(frequence_str,"22050Hz");break;
case 8: sprintf(frequence_str,"16000Hz");break;
case 9: sprintf(frequence_str,"12000Hz");break;
case 10: sprintf(frequence_str,"11025Hz");break;
case 11: sprintf(frequence_str,"8000Hz");break;
default:sprintf(frequence_str,"unknown");break;
}
fprintf(myout,"%5d| %8s| %8s| %5d|
",cnt,profile_str ,frequence_str,size);
data_size -= size;
input_data += size;
cnt++;
}
}
fclose(ifile);
free(aacbuffer);
free(aacframe);
return 0;
}