liveMedia/MPEG4GenericRTPSource.cpp File Reference

#include "MPEG4GenericRTPSource.hh"
#include "BitVector.hh"
#include "MPEG4LATMAudioRTPSource.hh"

Include dependency graph for MPEG4GenericRTPSource.cpp:

Go to the source code of this file.

Data Structures

class  MPEG4GenericBufferedPacket
class  MPEG4GenericBufferedPacketFactory
struct  AUHeader

Functions

unsigned samplingFrequencyFromAudioSpecificConfig (char const *configStr)

Variables

static unsigned const samplingFrequencyFromIndex [16]


Function Documentation

unsigned samplingFrequencyFromAudioSpecificConfig ( char const *  configStr  ) 

Definition at line 210 of file MPEG4GenericRTPSource.cpp.

References NULL, parseGeneralConfigStr(), and samplingFrequencyFromIndex.

Referenced by SubsessionIOState::setQTstate().

00210                                                                          {
00211   unsigned char* config = NULL;
00212   unsigned result = 0; // if returned, indicates an error
00213 
00214   do {
00215     // Begin by parsing the config string:
00216     unsigned configSize;
00217     config = parseGeneralConfigStr(configStr, configSize);
00218     if (config == NULL) break;
00219 
00220     if (configSize < 2) break;
00221     unsigned char samplingFrequencyIndex = ((config[0]&0x07)<<1) | (config[1]>>7);
00222     if (samplingFrequencyIndex < 15) {
00223       result = samplingFrequencyFromIndex[samplingFrequencyIndex];
00224       break;
00225     }
00226 
00227     // Index == 15 means that the actual frequency is next (24 bits):
00228     if (configSize < 5) break;
00229     result = ((config[1]&0x7F)<<17) | (config[2]<<9) | (config[3]<<1) | (config[4]>>7);
00230   } while (0);
00231 
00232   delete[] config;
00233   return result;
00234 }


Variable Documentation

unsigned const samplingFrequencyFromIndex[16] [static]

Initial value:

 {
  96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
  16000, 12000, 11025, 8000, 7350, 0, 0, 0
}

Definition at line 205 of file MPEG4GenericRTPSource.cpp.

Referenced by samplingFrequencyFromAudioSpecificConfig().


Generated on Thu May 17 07:14:14 2012 for live by  doxygen 1.5.2