|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Definitions for RTSP streaming. More...
#include <moonlight-common-c/src/Limelight-internal.h>#include <moonlight-common-c/src/Rtsp.h>#include <array>#include <cctype>#include <format>#include <set>#include <unordered_map>#include <utility>#include <boost/asio.hpp>#include <boost/bind.hpp>#include "config.h"#include "globals.h"#include "input.h"#include "logging.h"#include "network.h"#include "rtsp.h"#include "stream.h"#include "sync.h"#include "video.h"Classes | |
| struct | rtsp_stream::encrypted_rtsp_header_t |
| Encrypted RTSP message header used by GameStream. More... | |
| class | rtsp_stream::rtsp_server_t |
| RTSP listener that matches incoming clients to pending launch sessions. More... | |
| class | rtsp_stream::socket_t |
| RTSP client socket state and receive buffer parser. More... | |
Typedefs | |
| using | rtsp_stream::cmd_func_t = std::function<void(rtsp_server_t *server, tcp::socket &, launch_session_t &, msg_t &&)> |
| RTSP command handler signature used by the server dispatch table. | |
| using | rtsp_stream::msg_t = util::safe_ptr<RTSP_MESSAGE, free_msg> |
| Owning pointer for an RTSP message allocated by moonlight-common-c. | |
Functions | |
| void | rtsp_stream::cmd_announce (rtsp_server_t *server, tcp::socket &sock, launch_session_t &session, msg_t &&req) |
| Handle RTSP ANNOUNCE requests from the client. | |
| void | rtsp_stream::cmd_describe (rtsp_server_t *server, tcp::socket &sock, launch_session_t &session, msg_t &&req) |
| Handle RTSP DESCRIBE requests. | |
| void | rtsp_stream::cmd_not_found (tcp::socket &sock, launch_session_t &, msg_t &&req) |
| Send the RTSP response used for unsupported commands. | |
| void | rtsp_stream::cmd_option (rtsp_server_t *server, tcp::socket &sock, launch_session_t &session, msg_t &&req) |
| Handle RTSP OPTIONS requests. | |
| void | rtsp_stream::cmd_play (rtsp_server_t *server, tcp::socket &sock, launch_session_t &session, msg_t &&req) |
| Handle RTSP PLAY requests and start streaming. | |
| void | rtsp_stream::cmd_setup (rtsp_server_t *server, tcp::socket &sock, launch_session_t &session, msg_t &&req) |
| Handle RTSP SETUP requests and prepare transport state. | |
| void | rtsp_stream::free_msg (PRTSP_MESSAGE msg) |
| Release msg resources. | |
| void | rtsp_stream::launch_session_clear (uint32_t launch_session_id) |
| Clear state for the specified launch session. | |
| void | rtsp_stream::launch_session_raise (std::shared_ptr< launch_session_t > launch_session) |
| Queue a launch session until the RTSP client connects. | |
| void | rtsp_stream::print_msg (PRTSP_MESSAGE msg) |
| Write msg details to the log. | |
| void | rtsp_stream::respond (tcp::socket &sock, launch_session_t &session, msg_t &resp) |
| Send the protocol response for the current request. | |
| void | rtsp_stream::respond (tcp::socket &sock, launch_session_t &session, POPTION_ITEM options, int statuscode, const char *status_msg, int seqn, const std::string_view &payload) |
| Send the protocol response for the current request. | |
| int | rtsp_stream::send (tcp::socket &sock, const std::string_view &sv) |
| Send the serialized response over the active socket. | |
| int | rtsp_stream::session_count () |
| Get the number of active sessions. | |
| void | rtsp_stream::start () |
| Runs the RTSP server loop. | |
| void | rtsp_stream::terminate_sessions () |
| Terminates all running streaming sessions. | |
| void | rtsp_stream::terminate_sessions_by_cert (std::string_view cert) |
| Terminate active sessions associated with a client certificate. | |
Variables | |
| rtsp_server_t | rtsp_stream::server {} |
| Singleton RTSP server used by GameStream launch sessions. | |
Definitions for RTSP streaming.
| void rtsp_stream::cmd_announce | ( | rtsp_server_t * | server, |
| tcp::socket & | sock, | ||
| launch_session_t & | session, | ||
| msg_t && | req ) |
Handle RTSP ANNOUNCE requests from the client.
| server | RTSP server instance handling the request. |
| sock | Socket used to read or write the protocol message. |
| session | Active streaming or pairing session for the request. |
| req | Parsed RTSP request being handled. |
| void rtsp_stream::cmd_describe | ( | rtsp_server_t * | server, |
| tcp::socket & | sock, | ||
| launch_session_t & | session, | ||
| msg_t && | req ) |
Handle RTSP DESCRIBE requests.
| server | RTSP server instance. |
| sock | Client socket. |
| session | Launch session. |
| req | RTSP request message. |
GFE advertises incorrect mapping for normal quality configurations, as a result, Moonlight rotates all channels from index '3' to the right To work around this, rotate channels to the left from index '3'
| void rtsp_stream::cmd_not_found | ( | tcp::socket & | sock, |
| launch_session_t & | session, | ||
| msg_t && | req ) |
Send the RTSP response used for unsupported commands.
Handle an unsupported RTSP command.
| sock | Socket used to read or write the protocol message. |
| session | Active streaming or pairing session for the request. |
| req | Parsed RTSP request being handled. |
| void rtsp_stream::cmd_option | ( | rtsp_server_t * | server, |
| tcp::socket & | sock, | ||
| launch_session_t & | session, | ||
| msg_t && | req ) |
Handle RTSP OPTIONS requests.
| server | RTSP server instance handling the request. |
| sock | Socket used to read or write the protocol message. |
| session | Active streaming or pairing session for the request. |
| req | Parsed RTSP request being handled. |
| void rtsp_stream::cmd_play | ( | rtsp_server_t * | server, |
| tcp::socket & | sock, | ||
| launch_session_t & | session, | ||
| msg_t && | req ) |
Handle RTSP PLAY requests and start streaming.
| server | RTSP server instance handling the request. |
| sock | Socket used to read or write the protocol message. |
| session | Active streaming or pairing session for the request. |
| req | Parsed RTSP request being handled. |
| void rtsp_stream::cmd_setup | ( | rtsp_server_t * | server, |
| tcp::socket & | sock, | ||
| launch_session_t & | session, | ||
| msg_t && | req ) |
Handle RTSP SETUP requests and prepare transport state.
| server | RTSP server instance handling the request. |
| sock | Socket used to read or write the protocol message. |
| session | Active streaming or pairing session for the request. |
| req | Parsed RTSP request being handled. |
| void rtsp_stream::free_msg | ( | PRTSP_MESSAGE | msg | ) |
Release msg resources.
| msg | Raw RTSP message buffer being parsed or encrypted. |
| void rtsp_stream::launch_session_clear | ( | uint32_t | launch_session_id | ) |
Clear state for the specified launch session.
| launch_session_id | The ID of the session to clear. |
| void rtsp_stream::launch_session_raise | ( | std::shared_ptr< launch_session_t > | launch_session | ) |
Queue a launch session until the RTSP client connects.
| launch_session | Session state prepared by the GameStream launch handler. |
| void rtsp_stream::print_msg | ( | PRTSP_MESSAGE | msg | ) |
Write msg details to the log.
| msg | Raw RTSP message buffer being parsed or encrypted. |
| void rtsp_stream::respond | ( | tcp::socket & | sock, |
| launch_session_t & | session, | ||
| msg_t & | resp ) |
Send the protocol response for the current request.
| sock | Socket used to read or write the protocol message. |
| session | Active streaming or pairing session for the request. |
| resp | RTSP response string to send to the client. |
| void rtsp_stream::respond | ( | tcp::socket & | sock, |
| launch_session_t & | session, | ||
| POPTION_ITEM | options, | ||
| int | statuscode, | ||
| const char * | status_msg, | ||
| int | seqn, | ||
| const std::string_view & | payload ) |
Send the protocol response for the current request.
| sock | Socket used to read or write the protocol message. |
| session | Active streaming or pairing session for the request. |
| options | Request options or socket options to apply. |
| statuscode | RTSP status code to send in the response. |
| status_msg | Status msg. |
| seqn | RTSP CSeq value associated with the request. |
| payload | Optional payload body to include in the response. |
| int rtsp_stream::send | ( | tcp::socket & | sock, |
| const std::string_view & | sv ) |
Send the serialized response over the active socket.
| sock | Socket used to read or write the protocol message. |
| sv | String view containing the text to inspect. |
| int rtsp_stream::session_count | ( | ) |
Get the number of active sessions.
| void rtsp_stream::terminate_sessions_by_cert | ( | std::string_view | cert | ) |
Terminate active sessions associated with a client certificate.
| cert | Certificate data or object used by the operation. |