|
arduino-audio-tools
|
RTSPServer - Audio Streaming Server (task-based) More...
#include <RTSPServer.h>


Public Types | |
| using | streamer_t = RTSPMediaStreamerBase< Platform > |
Public Member Functions | |
| RTSPServer (streamer_t &streamer, int port=8554, int core=1) | |
| ~RTSPServer () | |
| bool | begin () |
| Start server. | |
| bool | begin (const char *ssid, const char *password) |
| int | clientCount () |
| Get number of connected clients. | |
| void | end () |
| int | getPort () |
| Get the server port number. | |
| 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. | |
| void | serverThreadLoop () |
| void | sessionThreadLoop () |
Protected Attributes | |
| Platform::TcpClientType | client |
| int | client_count = 0 |
| int | core = 0 |
| unsigned long | lastRequestTime = 0 |
| bool(* | onSessionPathCb )(const char *, void *) = nullptr |
| void * | onSessionPathRef = nullptr |
| int | port = 554 |
| RtspSession< Platform > * | rtspSession = nullptr |
| Platform::TcpServerType * | server = nullptr |
| audio_tools::Task | serverTask {"RTSPServerThread", 10000, 5, core} |
| audio_tools::Task | sessionTask {"RTSPSessionTask", 8000, 8, core} |
| unsigned long | sessionTimeoutMs = 60000 |
| RTSPMediaStreamerBase< Platform > * | streamer = nullptr |
RTSPServer - Audio Streaming Server (task-based)
This class extends RTSPServerBase to add task/thread management for handling RTSP sessions. It schedules the main server loop and individual session loops as tasks, so that the server does not block the main loop on platforms that support threading (e.g., ESP32 with FreeRTOS).
Usage:
Only one client is served at a time: further clients are accepted when the active session has ended.
Inherits all protocol, session, and connection logic from RTSPServerBase. Only task scheduling and concurrency logic is implemented here.
| Platform | Target hardware platform (e.g., Arduino, ESP32) |
| using streamer_t = RTSPMediaStreamerBase<Platform> |
|
inline |
|
inline |
|
inlineprotectedinherited |
Accept new client if none is active.
|
inlinevirtual |
Start server.
Reimplemented from RTSPServerBase< Platform >.
|
inline |
|
inlineinherited |
Get number of connected clients.
|
inline |
|
inlineinherited |
Get the server port number.
|
inlineprotectedinherited |
Handle requests session if active.
|
inlineinherited |
Returns true if any client is connected.
|
inlineprotected |
|
inlineprotected |
|
inlineinherited |
Set callback for session path.
|
inlineinherited |
Set session timeout in milliseconds.
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |