Sunshine/sunshine/stream.h

49 lines
953 B
C
Raw Normal View History

//
// Created by loki on 6/5/19.
//
#ifndef SUNSHINE_STREAM_H
#define SUNSHINE_STREAM_H
2020-02-08 15:26:38 +00:00
#include <boost/asio.hpp>
2019-12-17 22:16:28 +00:00
2020-02-08 15:26:38 +00:00
#include "audio.h"
#include "crypto.h"
2021-05-17 19:21:57 +00:00
#include "video.h"
2020-02-08 15:26:38 +00:00
namespace stream {
constexpr auto VIDEO_STREAM_PORT = 9;
constexpr auto CONTROL_PORT = 10;
constexpr auto AUDIO_STREAM_PORT = 11;
2020-02-08 17:55:07 +00:00
struct session_t;
2020-02-08 15:26:38 +00:00
struct config_t {
audio::config_t audio;
video::config_t monitor;
2021-07-04 04:38:45 +00:00
2020-02-08 15:26:38 +00:00
int packetsize;
2021-07-04 04:38:45 +00:00
int minRequiredFecPackets;
int featureFlags;
int controlProtocolType;
2020-02-08 15:26:38 +00:00
std::optional<int> gcmap;
};
2020-02-09 23:33:12 +00:00
namespace session {
enum class state_e : int {
STOPPED,
STOPPING,
STARTING,
RUNNING,
};
2019-12-17 22:16:28 +00:00
2020-02-09 23:33:12 +00:00
std::shared_ptr<session_t> alloc(config_t &config, crypto::aes_t &gcm_key, crypto::aes_t &iv);
int start(session_t &session, const std::string &addr_string);
2020-02-08 15:26:38 +00:00
void stop(session_t &session);
2020-02-08 22:41:27 +00:00
void join(session_t &session);
2020-02-09 23:33:12 +00:00
state_e state(session_t &session);
2021-05-17 19:21:57 +00:00
} // namespace session
} // namespace stream
#endif //SUNSHINE_STREAM_H