Sunshine master
Self-hosted game stream host for Moonlight.
stream.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <utility>
9
10// lib includes
11#include <boost/asio.hpp>
12
13// local includes
14#include "audio.h"
15#include "crypto.h"
16#include "video.h"
17
18namespace stream {
19 constexpr auto VIDEO_STREAM_PORT = 9;
20 constexpr auto CONTROL_PORT = 10;
21 constexpr auto AUDIO_STREAM_PORT = 11;
22
23 struct session_t;
24
43
44 namespace session {
48 enum class state_e : int {
49 STOPPED,
50 STOPPING,
51 STARTING,
52 RUNNING,
53 };
54
62 std::shared_ptr<session_t> alloc(config_t &config, rtsp_stream::launch_session_t &launch_session);
70 int start(session_t &session, const std::string &addr_string);
76 void stop(session_t &session);
82 void join(session_t &session);
89 state_e state(session_t &session);
96 const std::string &client_cert(session_t &session);
97 } // namespace session
98} // namespace stream
Declarations for audio capture and encoding.
stream_t stream
Default stream configuration values used before file and CLI overrides.
Definition config.cpp:715
Declarations for cryptography functions.
constexpr auto CONTROL_PORT
GameStream base-port offset used for the control channel.
Definition stream.h:20
state_e
Enumerates supported state options.
Definition stream.h:48
@ STARTING
The session is starting.
@ STOPPED
The session is stopped.
@ RUNNING
The session is running.
@ STOPPING
The session is stopping.
constexpr auto VIDEO_STREAM_PORT
GameStream base-port offset used for the video UDP stream.
Definition stream.h:19
constexpr auto AUDIO_STREAM_PORT
GameStream base-port offset used for the audio UDP stream.
Definition stream.h:21
Audio capture and encoder settings for a stream.
Definition audio.h:55
RTSP launch session state shared with stream setup.
Definition rtsp.h:20
Stream configuration shared by capture and network senders.
Definition stream.h:28
uint32_t encryptionFlagsEnabled
Bitmask of GameStream encryption features enabled for the session.
Definition stream.h:39
int packetsize
Maximum payload size for network packets.
Definition stream.h:32
int controlProtocolType
GameStream control protocol variant selected by the client.
Definition stream.h:35
std::optional< int > gcmap
Optional game-controller mapping override from the launch request.
Definition stream.h:41
int videoQosType
Video QoS type.
Definition stream.h:37
int minRequiredFecPackets
Minimum recovery packets required before FEC is emitted.
Definition stream.h:33
video::config_t monitor
Video capture and encoder configuration for the selected monitor.
Definition stream.h:30
audio::config_t audio
Audio capture configuration for the stream.
Definition stream.h:29
int audioQosType
Audio QoS type.
Definition stream.h:36
int mlFeatureFlags
Moonlight feature flags negotiated for this session.
Definition stream.h:34
Runtime state for one audio/video streaming session.
Definition stream.cpp:473
Encoding configuration requested by a remote client.
Definition video.h:28
Declarations for video.