72a2d714ab
- cam_stream: shared JPEG feed for /pic, /stream and RTSP; RTSP server (port 554, TCP) with MJPEG video, G.711 mic audio and an ONVIF-style back channel to the speaker - cam_auth: RTSP Digest login and HTTP Basic / ?key= check on all endpoints - Mic task feeds HTTP and RTSP with a sticky channel choice
23 lines
910 B
C
23 lines
910 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include "esp_http_server.h"
|
|
|
|
#define CAM_AUTH_REALM "ESP32-Cam"
|
|
|
|
/* Set the single account used by every service (RTSP, /pic, /stream, /mic, /spk, /vol).
|
|
* user NULL or "" disables authentication completely.
|
|
* Use letters and digits only in the password, it also travels inside URLs. */
|
|
void cam_auth_init(const char *user, const char *pass);
|
|
bool cam_auth_enabled(void);
|
|
|
|
/* ---------- HTTP ----------
|
|
* Accepts either "Authorization: Basic ..." or "?key=<password>" in the URL.
|
|
* On failure it sends 401 itself and returns false, so a handler does:
|
|
* if (!cam_http_check(req)) return ESP_OK; */
|
|
bool cam_http_check(httpd_req_t *req);
|
|
|
|
/* ---------- RTSP (Digest, MD5, no qop) ---------- */
|
|
void cam_rtsp_make_nonce(char out[33]);
|
|
bool cam_rtsp_digest_ok(const char *method, const char *authz_header_value, const char *nonce);
|