clang-format
This commit is contained in:
@@ -23,14 +23,6 @@
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <aaudio/AAudio.h>
|
||||
#include <cassert>
|
||||
#include <netinet/tcp.h>
|
||||
#include <poll.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void wivrn::android::audio::exit()
|
||||
{
|
||||
@@ -96,7 +88,7 @@ int32_t wivrn::android::audio::microphone_data_cb(AAudioStream * stream, void *
|
||||
|
||||
if (self->exiting)
|
||||
{
|
||||
self->microphone_stop_ack= true;
|
||||
self->microphone_stop_ack = true;
|
||||
self->microphone_stop_ack.notify_all();
|
||||
return AAUDIO_CALLBACK_RESULT_STOP;
|
||||
}
|
||||
@@ -119,9 +111,7 @@ wivrn::android::audio::audio(const xrt::drivers::wivrn::to_headset::audio_stream
|
||||
AAudioStreamBuilder * builder;
|
||||
aaudio_result_t result = AAudio_createStreamBuilder(&builder);
|
||||
if (result != AAUDIO_OK)
|
||||
{
|
||||
throw std::runtime_error(std::string("Cannot create stream builder: ") + AAudio_convertResultToText(result));
|
||||
}
|
||||
|
||||
if (desc.microphone)
|
||||
{
|
||||
@@ -182,9 +172,7 @@ wivrn::android::audio::~audio()
|
||||
for (auto stream: {speaker, microphone})
|
||||
{
|
||||
if (stream)
|
||||
{
|
||||
AAudioStream_close(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace wivrn::android
|
||||
{
|
||||
class audio
|
||||
{
|
||||
static int32_t speaker_data_cb(AAudioStreamStruct*, void*, void*, int32_t);
|
||||
static int32_t microphone_data_cb(AAudioStreamStruct*, void*, void*, int32_t);
|
||||
static int32_t speaker_data_cb(AAudioStreamStruct *, void *, void *, int32_t);
|
||||
static int32_t microphone_data_cb(AAudioStreamStruct *, void *, void *, int32_t);
|
||||
|
||||
utils::ring_buffer<xrt::drivers::wivrn::audio_data, 1000> output_buffer;
|
||||
|
||||
@@ -52,6 +52,7 @@ class audio
|
||||
std::atomic<bool> exiting = false;
|
||||
|
||||
void exit();
|
||||
|
||||
public:
|
||||
audio(const audio &) = delete;
|
||||
audio & operator=(const audio &) = delete;
|
||||
|
||||
Reference in New Issue
Block a user