|
| struct | SendStats |
| | How long frame sends block the httpd task (every /stream send runs on it, and so does /commands). More...
|
| |
|
|
bool | start (httpd_handle_t server, FrameStore &store) |
| | Register the /stream WebSocket endpoint and start the stream task (core 1, priority 4).
|
| |
|
void | stop () |
| | Stop the stream task and release all resources. Call BEFORE httpd_stop. Safe to call repeatedly.
|
| |
|
uint32_t | frames_sent () const |
| |
|
SendStats | take_send_stats () |
| | The send counters; resets max_us. For the stats line (one reader).
|
| |
| size_t | viewer_count () const |
| | Connected /stream viewers (0 to frames::kMaxViewers).
|
| |
|
|
static void | on_session_closed (httpd_handle_t server, int sockfd) |
| | httpd close_fn: forget the viewer and close the socket (required when close_fn is set).
|
| |
|
|
static constexpr uint32_t | kSlowSendUs = 200000 |
| | 200 ms: a visible hitch at 16 fps
|
| |
◆ viewer_count()
| size_t StreamBroadcaster::viewer_count |
( |
| ) |
const |
Connected /stream viewers (0 to frames::kMaxViewers).
Safe from any task, including the httpd task (the /commands reply): it takes the broadcaster mutex, which every holder keeps for a few microseconds only and never while calling back into this method, so the caller cannot deadlock and waits at most that long (the FreeRTOS mutex has priority inheritance). Returns 0 before start() and once stop() has returned. Like the httpd callbacks it must not run concurrently with stop() (which frees the mutex); stop() has no caller today, and httpd must be stopped first.
The documentation for this class was generated from the following files: