Sunshine v2025.118.151840
Self-hosted game stream host for Moonlight.
stream.h
Go to the documentation of this file.
1
5#pragma once
6#include <utility>
7
8#include <boost/asio.hpp>
9
10#include "audio.h"
11#include "crypto.h"
12#include "video.h"
13
14namespace stream {
15 constexpr auto VIDEO_STREAM_PORT = 9;
16 constexpr auto CONTROL_PORT = 10;
17 constexpr auto AUDIO_STREAM_PORT = 11;
18
19 struct session_t;
20 struct config_t {
21 audio::config_t audio;
22 video::config_t monitor;
23
24 int packetsize;
25 int minRequiredFecPackets;
26 int mlFeatureFlags;
27 int controlProtocolType;
28 int audioQosType;
29 int videoQosType;
30
31 uint32_t encryptionFlagsEnabled;
32
33 std::optional<int> gcmap;
34 };
35
36 namespace session {
37 enum class state_e : int {
38 STOPPED,
39 STOPPING,
40 STARTING,
41 RUNNING,
42 };
43
44 std::shared_ptr<session_t>
45 alloc(config_t &config, rtsp_stream::launch_session_t &launch_session);
46 int
47 start(session_t &session, const std::string &addr_string);
48 void
49 stop(session_t &session);
50 void
51 join(session_t &session);
52 state_e
53 state(session_t &session);
54 } // namespace session
55} // namespace stream
Declarations for audio capture and encoding.
Declarations for cryptography functions.
state_e
Definition stream.h:37
@ STARTING
The session is starting.
@ STOPPED
The session is stopped.
@ RUNNING
The session is running.
@ STOPPING
The session is stopping.
Definition audio.h:43
Definition rtsp.h:15
Definition stream.h:20
Definition stream.cpp:336
Definition video.h:21
Declarations for video.