Added streamMainLoop function to Input class
This commit is contained in:
parent
c7ab3ac858
commit
a27cf083e6
2 changed files with 18 additions and 13 deletions
|
@ -387,16 +387,7 @@ namespace Mist {
|
||||||
it->second.lastms = 0;
|
it->second.lastms = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getNext();
|
std::string reason = streamMainLoop();
|
||||||
while (thisPacket && config->is_active && nProxy.userClient.isAlive()){
|
|
||||||
nProxy.bufferLivePacket(thisPacket, myMeta);
|
|
||||||
getNext();
|
|
||||||
nProxy.userClient.keepAlive();
|
|
||||||
}
|
|
||||||
std::string reason = "Unknown";
|
|
||||||
if (!thisPacket){reason = "Invalid packet";}
|
|
||||||
if (!config->is_active){reason = "received deactivate signal";}
|
|
||||||
if (!nProxy.userClient.isAlive()){reason = "buffer shutdown";}
|
|
||||||
|
|
||||||
closeStreamSource();
|
closeStreamSource();
|
||||||
|
|
||||||
|
@ -409,9 +400,22 @@ namespace Mist {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Input::finish(){
|
std::string Input::streamMainLoop(){
|
||||||
for( std::map<unsigned int, std::map<unsigned int, unsigned int> >::iterator it = pageCounter.begin(); it != pageCounter.end(); it++){
|
getNext();
|
||||||
for (std::map<unsigned int, unsigned int>::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++){
|
while (thisPacket && config->is_active && nProxy.userClient.isAlive()){
|
||||||
|
nProxy.bufferLivePacket(thisPacket, myMeta);
|
||||||
|
getNext();
|
||||||
|
nProxy.userClient.keepAlive();
|
||||||
|
}
|
||||||
|
if (!thisPacket){return "Invalid packet";}
|
||||||
|
if (!config->is_active){return "received deactivate signal";}
|
||||||
|
if (!nProxy.userClient.isAlive()){return "buffer shutdown";}
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
void Input::finish() {
|
||||||
|
for (std::map<unsigned int, std::map<unsigned int, unsigned int> >::iterator it = pageCounter.begin(); it != pageCounter.end(); it++) {
|
||||||
|
for (std::map<unsigned int, unsigned int>::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++) {
|
||||||
it2->second = 1;
|
it2->second = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace Mist {
|
||||||
virtual void convert();
|
virtual void convert();
|
||||||
virtual void serve();
|
virtual void serve();
|
||||||
virtual void stream();
|
virtual void stream();
|
||||||
|
virtual std::string streamMainLoop();
|
||||||
bool isAlwaysOn();
|
bool isAlwaysOn();
|
||||||
|
|
||||||
virtual void parseHeader();
|
virtual void parseHeader();
|
||||||
|
|
Loading…
Add table
Reference in a new issue