Rework the logic around waiting for capture to be in both single jpeg mode and streaming.
This commit is contained in:
parent
fd489c2c8d
commit
8c8a9ca32a
|
@ -472,14 +472,26 @@ bool MonitorStream::sendFrame(Image *image, SystemTimePoint timestamp) {
|
||||||
} // end bool MonitorStream::sendFrame(Image *image, SystemTimePoint timestamp)
|
} // end bool MonitorStream::sendFrame(Image *image, SystemTimePoint timestamp)
|
||||||
|
|
||||||
void MonitorStream::runStream() {
|
void MonitorStream::runStream() {
|
||||||
if (type == STREAM_SINGLE) {
|
|
||||||
// Not yet migrated over to stream class
|
// Notify capture that we might want to view
|
||||||
if (checkInitialised()) {
|
monitor->setLastViewed();
|
||||||
SingleImage(scale);
|
|
||||||
} else {
|
if (!checkInitialised()) {
|
||||||
|
if (monitor->Capturing() != Monitor::CAPTURING_ONDEMAND) {
|
||||||
fputs("Content-Type: multipart/x-mixed-replace; boundary=" BOUNDARY "\r\n\r\n", stdout);
|
fputs("Content-Type: multipart/x-mixed-replace; boundary=" BOUNDARY "\r\n\r\n", stdout);
|
||||||
sendTextFrame("Unable to send image");
|
sendTextFrame("Unable to send image");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
while (!zm_terminate && !checkInitialised()) {
|
||||||
|
Debug(1, "Waiting for capture");
|
||||||
|
usleep(100000);
|
||||||
|
monitor->setLastViewed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == STREAM_SINGLE) {
|
||||||
|
// Not yet migrated over to stream class
|
||||||
|
SingleImage(scale);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue