2019-12-03 19:23:33 +00:00
|
|
|
//
|
|
|
|
// Created by loki on 6/5/19.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SUNSHINE_STREAM_H
|
|
|
|
#define SUNSHINE_STREAM_H
|
|
|
|
|
2019-12-17 22:16:28 +00:00
|
|
|
#include <atomic>
|
|
|
|
|
2019-12-03 19:23:33 +00:00
|
|
|
#include "crypto.h"
|
2019-12-15 22:10:44 +00:00
|
|
|
#include "thread_safe.h"
|
2020-01-19 23:22:13 +00:00
|
|
|
|
2019-12-03 19:23:33 +00:00
|
|
|
namespace stream {
|
|
|
|
|
2020-01-19 23:22:13 +00:00
|
|
|
enum class state_e : int {
|
|
|
|
STOPPED,
|
|
|
|
STOPPING,
|
|
|
|
STARTING,
|
|
|
|
RUNNING,
|
|
|
|
};
|
|
|
|
|
2019-12-15 22:10:44 +00:00
|
|
|
struct launch_session_t {
|
|
|
|
crypto::aes_t gcm_key;
|
|
|
|
crypto::aes_t iv;
|
2019-12-17 23:32:10 +00:00
|
|
|
|
|
|
|
bool has_process;
|
2019-12-15 22:10:44 +00:00
|
|
|
};
|
2019-12-03 19:23:33 +00:00
|
|
|
|
2019-12-15 22:10:44 +00:00
|
|
|
extern safe::event_t<launch_session_t> launch_event;
|
2020-01-19 23:22:13 +00:00
|
|
|
extern std::atomic<state_e> session_state;
|
2019-12-17 22:16:28 +00:00
|
|
|
|
2020-01-19 23:22:13 +00:00
|
|
|
void rtpThread(std::shared_ptr<safe::event_t<bool>> shutdown_event);
|
2019-12-03 19:23:33 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //SUNSHINE_STREAM_H
|