Sunshine/src/stream.h
Joey Yakimowich-Payne 0c16e913da
Some checks failed
ci-bundle.yml / Phase 2 (push) Failing after 0s
ci-copr.yml / Phase 2 (push) Failing after 0s
ci-homebrew.yml / Phase 2 (push) Failing after 0s
Phase 2
2026-02-11 13:44:02 -07:00

64 lines
1.5 KiB
C++

/**
* @file src/stream.h
* @brief Declarations for the streaming protocols.
*/
#pragma once
// standard includes
#include <string>
#include <utility>
#include <vector>
// lib includes
#include <boost/asio.hpp>
#include <nlohmann/json.hpp>
// local includes
#include "audio.h"
#include "crypto.h"
#include "video.h"
namespace stream {
constexpr auto VIDEO_STREAM_PORT = 9;
constexpr auto CONTROL_PORT = 10;
constexpr auto AUDIO_STREAM_PORT = 11;
constexpr uint64_t KB_ACTIVE_WINDOW_MS = 500;
constexpr uint64_t MOUSE_ACTIVE_WINDOW_MS = 500;
constexpr uint64_t GAMEPAD_ACTIVE_WINDOW_MS = 500;
struct session_t;
nlohmann::json get_active_sessions_info();
struct config_t {
audio::config_t audio;
video::config_t monitor;
int packetsize;
int minRequiredFecPackets;
int mlFeatureFlags;
int controlProtocolType;
int audioQosType;
int videoQosType;
uint32_t encryptionFlagsEnabled;
std::optional<int> gcmap;
};
namespace session {
enum class state_e : int {
STOPPED, ///< The session is stopped
STOPPING, ///< The session is stopping
STARTING, ///< The session is starting
RUNNING, ///< The session is running
};
std::shared_ptr<session_t> alloc(config_t &config, rtsp_stream::launch_session_t &launch_session);
int start(session_t &session, const std::string &addr_string);
void stop(session_t &session);
void join(session_t &session);
state_e state(session_t &session);
} // namespace session
} // namespace stream