Files
esp32cam-rtsp/lib/rtsp_server/rtsp_server.h
Rene Zeldenthuis b0522218f6 first commit
2022-07-03 23:42:14 +02:00

36 lines
705 B
C++

#pragma once
#include <list>
#include <WiFiServer.h>
#include <ESPmDNS.h>
#include <OV2640.h>
#include <CRtspSession.h>
#include <arduino-timer.h>
class rtsp_server : public WiFiServer
{
public:
rtsp_server(OV2640 &cam, unsigned long interval, int port = 554);
void doLoop();
private:
struct rtsp_client
{
public:
rtsp_client(const WiFiClient &client, OV2640 &cam);
WiFiClient wifi_client;
// Streamer for UDP/TCP based RTP transport
std::shared_ptr<CStreamer> streamer;
// RTSP session and state
std::shared_ptr<CRtspSession> session;
};
OV2640 cam_;
std::list<std::unique_ptr<rtsp_client>> clients_;
uintptr_t task_;
Timer<> timer_;
static bool client_handler(void *);
};