void start(int port);
void add_data(const char *buf, size_t size, bool keyframe);
+ int64_t get_num_connected_clients() const {
+ return metric_num_connected_clients.load();
+ }
private:
static int answer_to_connection_thunk(void *cls, MHD_Connection *connection,
void MainWindow::closeEvent(QCloseEvent *event)
{
+ if (global_mixer->get_num_connected_clients() > 0) {
+ QMessageBox::StandardButton reply =
+ QMessageBox::question(this, "Nageru", "There are clients connected. Do you really want to quit?",
+ QMessageBox::Yes | QMessageBox::No);
+ if (reply != QMessageBox::Yes) {
+ event->ignore();
+ return;
+ }
+ }
+
analyzer->hide();
event->accept();
}
display_timecode_on_stdout = enable;
}
+ int64_t get_num_connected_clients() const {
+ return httpd.get_num_connected_clients();
+ }
+
private:
struct CaptureCard;