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