Commit 0cc2ff71 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Add iLBC codec. Non tested

You have to copy the codec_ilbc.so in /usr/lib and make ldconfig
parent e103d846
......@@ -31,17 +31,26 @@
CodecDescriptor::CodecDescriptor()
{
// Default codecs
_codecMap[PAYLOAD_CODEC_ALAW] = "PCMA";
_codecMap[PAYLOAD_CODEC_ULAW] = "PCMU";
_codecMap[PAYLOAD_CODEC_GSM] = "GSM";
//_codecMap[PAYLOAD_CODEC_ALAW] = "PCMA";
#ifdef HAVE_SPEEX
//_codecMap[PAYLOAD_CODEC_SPEEX] = new CodecSpeex(PAYLOAD_CODEC_SPEEX); // TODO: this is a variable payload!
_codecMap[PAYLOAD_CODEC_SPEEX] = new CodecSpeex(PAYLOAD_CODEC_SPEEX); // TODO: this is a variable payload!
#endif
// theses one are not implemented yet..
// _codecMap[PAYLOAD_CODEC_ILBC] = Ilbc();
_codecMap[PAYLOAD_CODEC_ILBC] = "iLBC";
// _codecMap[PAYLOAD_CODEC_SPEEX] = Speex();
}
void
CodecDescriptor::init()
{
_codecMap[PAYLOAD_CODEC_ULAW] = "PCMU";
_codecMap[PAYLOAD_CODEC_GSM] = "GSM";
_codecMap[PAYLOAD_CODEC_ALAW] = "PCMA";
_codecMap[PAYLOAD_CODEC_ILBC] = "iLBC";
}
std::string&
CodecDescriptor::getCodecName(CodecType payload)
{
......
......@@ -68,6 +68,8 @@ public:
*/
std::string& getCodecName(CodecType payload);
void init();
/**
* Check in the map codec if the specified codec is supported
* @param payload unique identifier of a codec (RFC)
......
......@@ -1057,9 +1057,9 @@ ManagerImpl::initConfigFile (void)
fill_config_int(DRIVER_NAME_OUT, DFT_DRIVER_STR);
fill_config_int(DRIVER_SAMPLE_RATE, DFT_SAMPLE_RATE);
fill_config_int(DRIVER_FRAME_SIZE, DFT_FRAME_SIZE);
fill_config_str(CODEC1, DFT_CODEC1);
fill_config_str(CODEC2, DFT_CODEC2);
fill_config_str(CODEC3, DFT_CODEC3);
//fill_config_str(CODEC1, DFT_CODEC1);
//fill_config_str(CODEC2, DFT_CODEC2);
//fill_config_str(CODEC3, DFT_CODEC3);
fill_config_str(RING_CHOICE, DFT_RINGTONE);
fill_config_int(VOLUME_SPKR, DFT_VOL_SPKR_STR);
fill_config_int(VOLUME_MICRO, DFT_VOL_MICRO_STR);
......@@ -1087,11 +1087,13 @@ void
ManagerImpl::initAudioCodec (void)
{
_debugInit("Active Codecs");
_codecDescriptorMap.init();
}
void
ManagerImpl::setPreferedCodec(const ::DBus::String& codec_name)
{
{ _debug("Set Prefered Order\n");
/*
std::vector<std::string> list = getCodecList();
std::string tmp;
int i=0;
......@@ -1103,6 +1105,7 @@ ManagerImpl::setPreferedCodec(const ::DBus::String& codec_name)
setConfig("Audio", "Codecs.codec1", list[0]);
setConfig("Audio", "Codecs.codec2", list[1]);
setConfig("Audio", "Codecs.codec3", list[2]);
*/
}
std::string
......@@ -1149,13 +1152,19 @@ ManagerImpl::clockRate(std::string& name)
std::vector< std::string >
ManagerImpl::getCodecList( void )
{
std::vector< std::string > v;
std::string desc=getConfigString(AUDIO, "Codecs.codec1");
//std::string rate=clockRate(desc).strstream();
//printf("%s\n",rate.c_str());
v.push_back(getConfigString(AUDIO, "Codecs.codec1"));
v.push_back( getConfigString(AUDIO, "Codecs.codec2"));
v.push_back( getConfigString(AUDIO, "Codecs.codec3"));
CodecMap codecs = _codecDescriptorMap.getCodecMap();
CodecMap::iterator iter = codecs.begin();
while(iter!=codecs.end())
{
if(iter->first!=-1)
{
printf("codec: %s\n", iter->second.data());
v.push_back(iter->second.data());
}
iter++;
}
return v;
}
......
......@@ -67,6 +67,7 @@
#define CODEC1 "Codecs.codec1"
#define CODEC2 "Codecs.codec2"
#define CODEC3 "Codecs.codec3"
#define CODEC4 "Codecs.codec4"
#define RING_CHOICE "Rings.ringChoice"
#define ACCOUNT_SIP_COUNT_DEFAULT 4
#define ACCOUNT_IAX_COUNT_DEFAULT 4
......@@ -100,6 +101,7 @@
#define DFT_CODEC1 "G711u"
#define DFT_CODEC2 "G711a"
#define DFT_CODEC3 "GSM"
#define DFT_CODEC4 "iLBC"
#define DFT_RINGTONE "konga.ul"
#define DFT_SKIN "metal"
#define DFT_ZONE "North America"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment