output/wasapi: eliminate `friend` declaration
This commit is contained in:
parent
1fe0c673bc
commit
73f9824ddf
|
@ -158,7 +158,6 @@ SetDSDFallback(AudioFormat &audio_format) noexcept
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
class WasapiOutputThread {
|
class WasapiOutputThread {
|
||||||
friend class WasapiOutput;
|
|
||||||
Thread thread{BIND_THIS_METHOD(Work)};
|
Thread thread{BIND_THIS_METHOD(Work)};
|
||||||
WinEvent event;
|
WinEvent event;
|
||||||
WinEvent data_poped;
|
WinEvent data_poped;
|
||||||
|
@ -204,6 +203,11 @@ public:
|
||||||
void Play() noexcept { return SetStatus(Status::PLAY); }
|
void Play() noexcept { return SetStatus(Status::PLAY); }
|
||||||
void Pause() noexcept { return SetStatus(Status::PAUSE); }
|
void Pause() noexcept { return SetStatus(Status::PAUSE); }
|
||||||
|
|
||||||
|
std::size_t Push(ConstBuffer<void> input) noexcept {
|
||||||
|
return spsc_buffer.push(static_cast<const BYTE *>(input.data),
|
||||||
|
input.size);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instruct the thread to discard the buffer (and wait for
|
* Instruct the thread to discard the buffer (and wait for
|
||||||
* completion). This needs to be done inside this thread,
|
* completion). This needs to be done inside this thread,
|
||||||
|
@ -672,8 +676,7 @@ WasapiOutput::Play(const void *chunk, size_t size)
|
||||||
return size;
|
return size;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
const size_t consumed_size = thread->spsc_buffer.push(
|
const size_t consumed_size = thread->Push({chunk, size});
|
||||||
static_cast<const BYTE *>(input.data), input.size);
|
|
||||||
|
|
||||||
if (!is_started) {
|
if (!is_started) {
|
||||||
is_started = true;
|
is_started = true;
|
||||||
|
|
Loading…
Reference in New Issue