2019-12-03 19:23:33 +00:00
|
|
|
#ifndef SUNSHINE_AUDIO_H
|
|
|
|
#define SUNSHINE_AUDIO_H
|
|
|
|
|
2019-12-11 18:06:52 +00:00
|
|
|
#include "thread_safe.h"
|
2021-05-17 19:21:57 +00:00
|
|
|
#include "utility.h"
|
2019-12-03 19:23:33 +00:00
|
|
|
namespace audio {
|
2021-05-19 16:11:06 +00:00
|
|
|
enum stream_config_e : int {
|
|
|
|
STEREO,
|
|
|
|
SURROUND51,
|
|
|
|
HIGH_SURROUND51,
|
|
|
|
SURROUND71,
|
|
|
|
HIGH_SURROUND71,
|
|
|
|
MAX_STREAM_CONFIG
|
|
|
|
};
|
|
|
|
|
|
|
|
struct opus_stream_config_t {
|
|
|
|
std::int32_t sampleRate;
|
|
|
|
int channelCount;
|
|
|
|
int streams;
|
|
|
|
int coupledStreams;
|
|
|
|
const std::uint8_t *mapping;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern opus_stream_config_t stream_configs[MAX_STREAM_CONFIG];
|
|
|
|
|
2019-12-03 19:23:33 +00:00
|
|
|
struct config_t {
|
2021-05-19 19:44:42 +00:00
|
|
|
enum flags_e : int {
|
|
|
|
HIGH_QUALITY,
|
|
|
|
HOST_AUDIO,
|
|
|
|
MAX_FLAGS
|
|
|
|
};
|
|
|
|
|
2019-12-03 19:23:33 +00:00
|
|
|
int packetDuration;
|
|
|
|
int channels;
|
|
|
|
int mask;
|
2021-05-19 16:11:06 +00:00
|
|
|
|
2021-05-19 19:44:42 +00:00
|
|
|
std::bitset<MAX_FLAGS> flags;
|
2019-12-03 19:23:33 +00:00
|
|
|
};
|
|
|
|
|
2021-06-22 20:26:11 +00:00
|
|
|
using buffer_t = util::buffer_t<std::uint8_t>;
|
|
|
|
using packet_t = std::pair<void *, buffer_t>;
|
|
|
|
void capture(safe::mail_t mail, config_t config, void *channel_data);
|
2021-05-17 19:21:57 +00:00
|
|
|
} // namespace audio
|
2019-12-03 19:23:33 +00:00
|
|
|
|
|
|
|
#endif
|