nadjieb / cpp-mjpeg-streamer

C++ MJPEG over HTTP Library
MIT License
135 stars 39 forks source link

Feature Request #32

Closed d-a-v closed 2 years ago

d-a-v commented 2 years ago

Thanks for this library, I am successfully using it with a thermal camera !

I have two questions: In the example's main loop,

The goal is to be able to shut down the camera until new clients connects, and wait quietly until then.

ricardojlrufino commented 2 years ago

// only capture if exist client.. if(!streamer.hasClient("/bgr")){ std::this_thread::sleep_for(std::chrono::milliseconds(250)); continue; }

kamalnadjieb commented 2 years ago

Hi @d-a-v , sorry for the late reply.

Currently the nadjieb::MJPEGStreamer class only have a public method to check if a topic has client(s) connected. I need to review the overall design goal to decide whether the class need such method to be implemented. For now, I think you can modify @ricardojlrufino implementation above to suite your need. Thank you.

Regards,

Kamal