62 double packetSize =
brt*
wt;
71 void AEVideo::doIni() {
72 startVar = par(
"startVar");
75 cXMLElement* slXml = NULL;
76 if (par(
"streamList").xmlValue() != NULL && par(
"streamList").xmlValue()->hasChildren()){
77 slXml = par(
"streamList").xmlValue();
79 error(
"streamList parameter not initialized!");
82 cXMLElementList streamsXML = slXml->getChildrenByTagName(
"Stream");
83 for (cXMLElementList::iterator it = streamsXML.begin(); it != streamsXML.end(); ++it) {
86 std::string streamType =
"";
87 if (m->getAttribute(
"type")) {
88 streamType = m->getAttribute(
"type");
92 if(streamType ==
"LR" || streamType ==
"1"){
95 }
else if(streamType ==
"SD" || streamType ==
"2"){
98 }
else if(streamType ==
"HD" || streamType ==
"3"){
103 cXMLElementList attrs = m->getChildren();
104 for (cXMLElementList::iterator jt = attrs.begin(); jt != attrs.end(); ++jt) {
105 cXMLElement* n = *jt;
106 if ( !strcmp(n->getTagName(),
"fps") ) {
107 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
108 if (v > 0) { st.
setFps(v); }
109 }
else if ( !strcmp(n->getTagName(),
"brt") ) {
110 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
111 if (v > 0) { st.
setBrt(v); }
112 }
else if ( !strcmp(n->getTagName(),
"varFr") ) {
113 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
115 }
else if ( !strcmp(n->getTagName(),
"rng") ) {
116 string nodeVal = n->getNodeValue();
117 if(nodeVal ==
"uniform"){
119 }
else if(nodeVal ==
"normal"){
126 streams.push_back(st);
130 void AEVideo::doFin(){
132 EV << maxSize <<endl;
135 void AEVideo::iniCom(){
136 for(
sVecIt it = streams.begin(); it != streams.end(); it++){
137 scheduleAt(uniform(simTime(), simTime()+startVar),
new Stream_Timer(it->getid()) );
147 sendMsg(
new _PingMsg(), min(data, maxSize));
double minMaxNormal(double a, double b, int rng)
void setRNG(RNG_function)
void setVarFrameS(double)
double(* RNG_function)(double, double, int rng)