mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 21:11:25 +12:00
Audio backend improvements
Callback based audio update. Upgraded common backend interface. Added Cubeb backend. Support multiple audio providers. Dropped pulse, alsa, openal backends.
This commit is contained in:
parent
a84223bdc6
commit
37a722cc1d
47 changed files with 1458 additions and 1329 deletions
31
Utilities/simple_ringbuf.h
Normal file
31
Utilities/simple_ringbuf.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include "util/types.hpp"
|
||||
#include "util/atomic.hpp"
|
||||
|
||||
// Single reader/writer simple ringbuffer.
|
||||
// Counters are 32-bit.
|
||||
class simple_ringbuf
|
||||
{
|
||||
private:
|
||||
|
||||
atomic_t<u64> rw_ptr = 0;
|
||||
u32 buf_size = 0;
|
||||
std::unique_ptr<u8[]> buf{};
|
||||
atomic_t<bool> initialized = false;
|
||||
|
||||
public:
|
||||
|
||||
simple_ringbuf() {};
|
||||
simple_ringbuf(u32 size);
|
||||
|
||||
u32 get_free_size();
|
||||
u32 get_used_size();
|
||||
|
||||
// Thread unsafe functions.
|
||||
void set_buf_size(u32 size);
|
||||
void flush(); // Could be safely called from reader.
|
||||
|
||||
u32 push(const void *data, u32 size);
|
||||
u32 pop(void *data, u32 size);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue