|
INET Framework for OMNeT++/OMNEST
|
#include <App_voice.h>
Public Member Functions | |
| voice () | |
| virtual bool | loadConfig (const cXMLElement &appConfig) |
| virtual int | getDefaultPort () |
| virtual double | getNextPacketTime () |
| virtual int | getPacketSize () |
| virtual int | anotherEncapsulationOverhead () |
Private Attributes | |
| double | pps |
| int | codecRate |
| bool | vad |
Definition at line 26 of file App_voice.h.
| voice::voice | ( | ) | [inline] |
Definition at line 34 of file App_voice.h.
| int voice::anotherEncapsulationOverhead | ( | ) | [virtual] |
Implements ITrafGenApplication.
Definition at line 91 of file App_voice.cc.
{
return 12; // rtp hlavicka
}
| int voice::getDefaultPort | ( | ) | [virtual] |
| double voice::getNextPacketTime | ( | ) | [virtual] |
Implements ITrafGenApplication.
Definition at line 102 of file App_voice.cc.
| int voice::getPacketSize | ( | ) | [virtual] |
Implements ITrafGenApplication.
Definition at line 121 of file App_voice.cc.
| bool voice::loadConfig | ( | const cXMLElement & | appConfig | ) | [virtual] |
Implements ITrafGenApplication.
Definition at line 32 of file App_voice.cc.
{
cXMLElement* element;
element = appConfig.getFirstChildWithTag("codec");
if(element != NULL)
{// pouzity kodek
std::string codec = element->getNodeValue();
if(codec == "g711" || codec == "G.711")
codecRate = 64000;
else if(codec == "g729" || codec == "G.729")
codecRate = 8000;
}
element = appConfig.getFirstChildWithTag("codec_rate");
if(element != NULL) // explicitne definavana bitova rychlost
codecRate = atoi(element->getNodeValue());
element = appConfig.getFirstChildWithTag("packets_per_second");
if(element != NULL)
{
std::string ppsString = element->getNodeValue();
if(ppsString == "default")
pps = 50.0;
else
pps = atof(element->getNodeValue());
}
element = appConfig.getFirstChildWithTag("vad");
if(element != NULL)
{ // technologia VAD bude pouzita
std::string vadString = element->getNodeValue();
if(vadString == "true" || vadString == "True" || vadString == "TRUE")
vad = true;
}
if(pps == 0.0 || codecRate == 0)
return false; // chyba nacitania
return true;
}
int voice::codecRate [private] |
Definition at line 30 of file App_voice.h.
Referenced by getPacketSize(), and loadConfig().
double voice::pps [private] |
Definition at line 29 of file App_voice.h.
Referenced by getNextPacketTime(), getPacketSize(), and loadConfig().
bool voice::vad [private] |
Definition at line 31 of file App_voice.h.
Referenced by getNextPacketTime(), and loadConfig().