|
| RTSPServer (streamer_t &streamer, int port=8554, int core=1) |
| Construct RTSP server.
|
|
| ~RTSPServer () |
| Destructor - ensures proper cleanup of server resources.
|
|
bool | begin () |
|
int | clientCount () |
| Get the number of connected clients.
|
|
audio_tools::Task & | getTaskHandle () |
| Get the server task handle.
|
|
| operator bool () |
| Returns true if there is at least one connected client.
|
|
void | setOnSessionPath (bool(*cb)(const char *path, void *ref), void *ref=nullptr) |
| Set a callback to receive the RTSP URL path for each new session. The callback is forwarded to every RtspSession and invoked once per session after the first request is parsed.
|
|
void | setSessionTimoutMs (unsigned long ms) |
| Set the session timeout in milliseconds.
|
|
template<typename Platform>
class audio_tools::RTSPServer< Platform >
RTSP Server - Multi-client Audio Streaming Server.
The RTSPServer class implements a complete RTSP (Real Time Streaming Protocol) server that manages client connections and coordinates audio streaming sessions. This server:
- Listens for RTSP client connections on a configurable port (default 8554)
- Handles RTSP protocol negotiation (DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN)
- Manages multiple concurrent client sessions
- Coordinates with RTSPAudioStreamer for RTP audio delivery
- Runs asynchronously using AudioTools Task system
- Author
- Phil Schatzmann
RTSP Protocol Support
- DESCRIBE: Returns SDP session description with audio format
- SETUP: Establishes RTP transport parameters
- PLAY: Starts audio streaming to client
- PAUSE: Temporarily stops streaming without ending session
- TEARDOWN: Stops streaming and cleans up session
- OPTIONS: Returns supported RTSP methods
- Note
- Supports multiple platforms through AudioTools Task and Timer systems
template<typename Platform >
void sessionThreadLoop |
( |
| ) |
|
|
inlineprotected |
Client session thread loop - handles RTSP protocol for individual clients.
This member method runs in a dedicated Task for each connected client. It creates an RTSPSession object and processes RTSP requests (DESCRIBE, SETUP, PLAY, TEARDOWN) until the client disconnects or an error occurs.
- Note
- Each client gets its own session thread
-
Thread automatically terminates when client disconnects
-
Manages RTSPSession lifecycle and socket cleanup