|
char const * | dateHeader () |
|
void | detectClientHeaderPreference (char *req) |
|
void | determineCommandType () |
|
Platform::TcpClientType *& | getClient () |
|
uint16_t | getRtpClientPort () |
|
int | getStreamID () |
|
void | handleRtspDescribe () |
|
void | handleRtspOption () |
|
void | handleRtspPause () |
|
void | handleRtspPlay () |
|
RTSP_CMD_TYPES | handleRtspRequest (char const *aRequest, unsigned aRequestSize) |
|
void | handleRtspSetup () |
|
void | handleRtspTeardown () |
|
void | init () |
|
void | initTransport (u_short aRtpPort, u_short aRtcpPort) |
|
void | parseClientPorts (char *req) |
|
bool | parseCommandName (char *req, unsigned reqSize, unsigned &outIdx) |
|
void | parseContentLength (char *req, unsigned reqSize, unsigned startIdx) |
|
bool | parseCSeq (char *req, unsigned reqSize, unsigned startIdx) |
|
bool | parseRtspRequest (char const *aRequest, unsigned aRequestSize) |
|
void | parseTransportHeader (char *req) |
|
void | parseUrlHostPortAndSuffix (char *req, unsigned reqSize, unsigned &i) |
|
int | readSocket (typename Platform::TcpClientType *sock, char *buf, size_t buflen, int timeoutmsec) |
| Inline helper to read from socket.
|
|
ssize_t | sendSocket (typename Platform::TcpClientType *sock, const void *buf, size_t len) |
| Inline helper to send data over socket.
|
|
template<typename Platform>
class audio_tools::RtspSession< Platform >
RTSP Session Handler - Individual Client Protocol Management.
The RtspSession class manages RTSP protocol communication with a single client. It handles the complete RTSP session lifecycle from initial connection through streaming termination. Key responsibilities include:
- RTSP message parsing and protocol state management
- SDP (Session Description Protocol) generation for audio format negotiation
- RTP transport setup and coordination with RTSPAudioStreamer
- Session state tracking (INIT -> READY -> PLAYING)
- Client timeout and connection management
The memory for buffers is allocated in PSRAM if available and active.
RTSP Protocol Support
- OPTIONS - Client queries supported methods
- DESCRIBE - Server returns SDP with audio format details
- SETUP - Client requests RTP transport, server allocates ports
- PLAY - Client starts playback, server begins RTP streaming
- TEARDOWN - Client ends session, server cleans up resources
- Note
- This class is typically instantiated by RTSPServer, not directly by users
-
Requires a configured RTSPAudioStreamer for media delivery
- Author
- Thomas Pfitzinger
- Version
- 0.2.0
template<typename Platform >
bool handleRequests |
( |
uint32_t |
readTimeoutMs | ) |
|
|
inline |
Process incoming RTSP requests from the client.
Reads RTSP messages from the client socket and dispatches them to appropriate handler methods. This is the main processing loop for RTSP protocol communication. Supports all standard RTSP commands (OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN).
- Parameters
-
readTimeoutMs | Maximum time in milliseconds to wait for incoming data |
- Returns
- true if request was processed successfully, false on timeout or session end
- Note
- Returns false when client disconnects or times out
-
Filters messages to ensure they are valid RTSP commands
-
Should be called repeatedly in a loop until it returns false