arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RTSPServerBase< Platform > Class Template Reference

RTSPServerBase - Shared logic for RTSPServer and RTSPServerTaskless. More...

#include <RTSPServerBase.h>

Inheritance diagram for RTSPServerBase< Platform >:
RTSPServer< Platform > RTSPServerTaskless< Platform >

Public Member Functions

 RTSPServerBase (RTSPAudioStreamerBase< Platform > &streamer, int port=8554)
 Constructor.
 
 ~RTSPServerBase ()
 Destructor.
 
virtual bool begin ()
 Start server.
 
bool begin (const char *ssid, const char *password)
 Start server and connect to WiFi (ESP32 only)
 
int clientCount ()
 Get number of connected clients.
 
void end ()
 Stop server and clean up.
 
 operator bool ()
 Returns true if any client is connected.
 
void setOnSessionPath (bool(*cb)(const char *path, void *ref), void *ref=nullptr)
 Set callback for session path.
 
void setSessionTimeoutMs (unsigned long ms)
 Set session timeout in milliseconds.
 

Protected Member Functions

void acceptClient ()
 Accept new client if none is active.
 
void handleSession ()
 Handle requests session if active.
 

Protected Attributes

Platform::TcpClientType client
 
int client_count = 0
 
unsigned long lastRequestTime = 0
 
bool(* onSessionPathCb )(const char *, void *) = nullptr
 
voidonSessionPathRef = nullptr
 
int port = 554
 
RtspSession< Platform > * rtspSession = nullptr
 
Platform::TcpServerType * server = nullptr
 
unsigned long sessionTimeoutMs = 60000
 
RTSPAudioStreamerBase< Platform > * streamer = nullptr
 

Detailed Description

template<typename Platform>
class audio_tools::RTSPServerBase< Platform >

RTSPServerBase - Shared logic for RTSPServer and RTSPServerTaskless.

This class contains all protocol, session, and connection logic, but no task/timer code. Derived classes implement scheduling: either with tasks (RTSPServer) or manual loop (RTSPServerTaskless).

Template Parameters
PlatformTarget hardware platform (e.g., Arduino, ESP32)

Constructor & Destructor Documentation

◆ RTSPServerBase()

template<typename Platform >
RTSPServerBase ( RTSPAudioStreamerBase< Platform > &  streamer,
int  port = 8554 
)
inline

Constructor.

◆ ~RTSPServerBase()

template<typename Platform >
~RTSPServerBase ( )
inline

Destructor.

Member Function Documentation

◆ acceptClient()

template<typename Platform >
void acceptClient ( )
inlineprotected

Accept new client if none is active.

◆ begin() [1/2]

template<typename Platform >
virtual bool begin ( )
inlinevirtual

Start server.

Reimplemented in RTSPServer< Platform >, and RTSPServerTaskless< Platform >.

◆ begin() [2/2]

template<typename Platform >
bool begin ( const char ssid,
const char password 
)
inline

Start server and connect to WiFi (ESP32 only)

◆ clientCount()

template<typename Platform >
int clientCount ( )
inline

Get number of connected clients.

◆ end()

template<typename Platform >
void end ( )
inline

Stop server and clean up.

◆ handleSession()

template<typename Platform >
void handleSession ( )
inlineprotected

Handle requests session if active.

◆ operator bool()

template<typename Platform >
operator bool ( )
inline

Returns true if any client is connected.

◆ setOnSessionPath()

template<typename Platform >
void setOnSessionPath ( bool(*)(const char *path, void *ref)  cb,
void ref = nullptr 
)
inline

Set callback for session path.

◆ setSessionTimeoutMs()

template<typename Platform >
void setSessionTimeoutMs ( unsigned long  ms)
inline

Set session timeout in milliseconds.

Member Data Documentation

◆ client

template<typename Platform >
Platform::TcpClientType client
protected

◆ client_count

template<typename Platform >
int client_count = 0
protected

◆ lastRequestTime

template<typename Platform >
unsigned long lastRequestTime = 0
protected

◆ onSessionPathCb

template<typename Platform >
bool(* onSessionPathCb) (const char *, void *) = nullptr
protected

◆ onSessionPathRef

template<typename Platform >
void* onSessionPathRef = nullptr
protected

◆ port

template<typename Platform >
int port = 554
protected

◆ rtspSession

template<typename Platform >
RtspSession<Platform>* rtspSession = nullptr
protected

◆ server

template<typename Platform >
Platform::TcpServerType* server = nullptr
protected

◆ sessionTimeoutMs

template<typename Platform >
unsigned long sessionTimeoutMs = 60000
protected

◆ streamer

template<typename Platform >
RTSPAudioStreamerBase<Platform>* streamer = nullptr
protected

The documentation for this class was generated from the following file: