Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
stream_broadcaster.h File Reference

Pushes the latest camera frame to each idle /stream WebSocket viewer (drop-when-busy, low latency). More...

#include <array>
#include <atomic>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <esp_http_server.h>
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include <freertos/task.h>
#include "frame_slots.h"
#include "frame_store.h"
#include "viewer_set.h"

Go to the source code of this file.

Classes

class  StreamBroadcaster
 
struct  StreamBroadcaster::SendStats
 How long frame sends block the httpd task (every /stream send runs on it, and so does /commands). More...
 

Detailed Description

Pushes the latest camera frame to each idle /stream WebSocket viewer (drop-when-busy, low latency).

Sends run inside the HTTP server's own task via httpd_queue_work + httpd_ws_send_frame_async, the thread-safe way to use esp_http_server from another task. Each viewer has one preallocated send job, so the frame path allocates nothing. A viewer still receiving the previous frame is skipped, never queued.