Sunshine latest
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
25 struct config_t {
26 audio::config_t audio;
27 video::config_t monitor;
28
29 int packetsize;
30 int minRequiredFecPackets;
31 int mlFeatureFlags;
32 int controlProtocolType;
33 int audioQosType;
34 int videoQosType;
35
36 uint32_t encryptionFlagsEnabled;
37
38 std::optional<int> gcmap;
39 };
40
41 namespace session {
42 enum class state_e : int {
43 STOPPED,
44 STOPPING,
45 STARTING,
46 RUNNING,
47 };
48
49 std::shared_ptr<session_t> alloc(config_t &config, rtsp_stream::launch_session_t &launch_session);
50 int start(session_t &session, const std::string &addr_string);
51 void stop(session_t &session);
52 void join(session_t &session);
53 state_e 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:42
@ 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:17
Definition stream.h:25
Definition stream.cpp:326
Definition video.h:23
Declarations for video.