Sunshine/sunshine/stream.h

43 lines
808 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 {
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;
int packetsize;
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
2020-02-09 23:33:12 +00:00
extern safe::signal_t broadcast_shutdown_event;
2021-05-17 19:21:57 +00:00
} // namespace stream
#endif //SUNSHINE_STREAM_H