Skip to main content

Module state

Module state 

Source
Expand description

RTSP session state machine — RFC 2326 Appendix A.

Implements the client (§A.1) and server (§A.2) transition tables exactly as transcribed in docs/state-machines.md. State is tracked per session object (stream URL + session id); this module models a single object’s state.

The state-neutral methods OPTIONS, DESCRIBE, ANNOUNCE, GET_PARAMETER, and SET_PARAMETER are permitted in every state and never change it (RFC 2326 Appendix A intro). The state-affecting methods are SETUP, PLAY, PAUSE, TEARDOWN, RECORD, and REDIRECT.

Enums§

SessionState
The lifecycle state of an RTSP session object (RFC 2326 §A.1 / §A.2).

Functions§

client_next_state
Computes the next state for the client after receiving a 2xx success response to method sent in current state, per the RFC 2326 §A.1 client state table.
is_state_neutral
Returns true for the methods that do not affect session state and are therefore permitted in every state (RFC 2326 Appendix A intro).
server_next_state
Computes the next state for the server after sending a 2xx success response to a received method in current state, per the RFC 2326 §A.2 server state table.