Updated buffer and controller for upcoming features.
This commit is contained in:
parent
1986b1517b
commit
0a3b34e9b6
7 changed files with 306 additions and 451 deletions
|
@ -421,6 +421,24 @@ int main(int argc, char ** argv){
|
|||
if (Request.isMember("meta")){
|
||||
Controller::Storage["streams"][thisbuffer]["meta"] = Request["meta"];
|
||||
}
|
||||
if (Controller::Storage["streams"][thisbuffer].isMember("updated")){
|
||||
Controller::Storage["streams"][thisbuffer].removeMember("updated");
|
||||
if (Controller::Storage["streams"][thisbuffer].isMember("cut")){
|
||||
it->SendNow("c"+Controller::Storage["streams"][thisbuffer]["cut"].asString()+"\n");
|
||||
}else{
|
||||
it->SendNow("c0\n");
|
||||
}
|
||||
if (Controller::Storage["streams"][thisbuffer].isMember("DVR")){
|
||||
it->SendNow("d"+Controller::Storage["streams"][thisbuffer]["DVR"].asString()+"\n");
|
||||
}else{
|
||||
it->SendNow("d20000\n");
|
||||
}
|
||||
if (Controller::Storage["streams"][thisbuffer].isMember("source") && Controller::Storage["streams"][thisbuffer]["source"].asStringRef().substr(0, 7) == "push://"){
|
||||
it->SendNow("s"+Controller::Storage["streams"][thisbuffer]["source"].asStringRef().substr(7)+"\n");
|
||||
}else{
|
||||
it->SendNow("s127.0.01\n");
|
||||
}
|
||||
}
|
||||
if (Request.isMember("totals")){
|
||||
Controller::Storage["statistics"][thisbuffer]["curr"] = Request["curr"];
|
||||
std::string nowstr = Request["totals"]["now"].asString();
|
||||
|
|
|
@ -20,7 +20,10 @@ namespace Controller {
|
|||
if (one.isMember("source") != two.isMember("source") || one["source"] != two["source"]){
|
||||
return false;
|
||||
}
|
||||
if (one.isMember("DVR") != two.isMember("DVR") || one["DVR"] != two["DVR"]){
|
||||
if (one.isMember("DVR") != two.isMember("DVR") || (one.isMember("DVR") && one["DVR"] != two["DVR"])){
|
||||
return false;
|
||||
}
|
||||
if (one.isMember("cut") != two.isMember("cut") || (one.isMember("cut") && one["cut"] != two["cut"])){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -213,15 +216,24 @@ namespace Controller {
|
|||
out[jit->first].null();
|
||||
out[jit->first]["name"] = jit->first;
|
||||
out[jit->first]["source"] = jit->second["source"];
|
||||
out[jit->first]["DVR"] = jit->second["DVR"];
|
||||
out[jit->first]["DVR"] = jit->second["DVR"].asInt();
|
||||
out[jit->first]["cut"] = jit->second["cut"].asInt();
|
||||
out[jit->first]["updated"] = 1ll;
|
||||
Log("STRM", std::string("Updated stream ") + jit->first);
|
||||
Util::Procs::Stop(jit->first);
|
||||
startStream(jit->first, out[jit->first]);
|
||||
if (out[jit->first]["source"].asStringRef().substr(0, 7) != "push://"){
|
||||
Util::Procs::Stop(jit->first);
|
||||
startStream(jit->first, out[jit->first]);
|
||||
}else{
|
||||
if ( !Util::Procs::isActive(jit->first)){
|
||||
startStream(jit->first, out[jit->first]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
out[jit->first]["name"] = jit->first;
|
||||
out[jit->first]["source"] = jit->second["source"];
|
||||
out[jit->first]["DVR"] = jit->second["DVR"];
|
||||
out[jit->first]["DVR"] = jit->second["DVR"].asInt();
|
||||
out[jit->first]["cut"] = jit->second["cut"].asInt();
|
||||
Log("STRM", std::string("New stream ") + jit->first);
|
||||
startStream(jit->first, out[jit->first]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue