11 #include "cores/AudioEngine/Interfaces/AESink.h" 12 #include "cores/AudioEngine/Utils/AEDeviceInfo.h" 13 #include "cores/AudioEngine/Utils/AEUtil.h" 14 #include "threads/CriticalSection.h" 15 #include "threads/SystemClock.h" 16 #include "threads/Thread.h" 21 #include <pulse/pulseaudio.h> 22 #include <pulse/simple.h> 29 const char *GetName()
override {
return "PULSE"; }
34 static bool Register();
36 static void EnumerateDevicesEx(AEDeviceInfoList &list,
bool force =
false);
37 static void Cleanup();
39 bool Initialize(
AEAudioFormat &format, std::string &device)
override;
40 void Deinitialize()
override;
42 virtual double GetDelay() {
return 0.0; }
44 double GetCacheTotal()
override;
45 unsigned int AddPackets(uint8_t **data,
unsigned int frames,
unsigned int offset)
override;
46 void Drain()
override;
48 bool HasVolume()
override {
return true; }
49 void SetVolume(
float volume)
override;
52 void UpdateInternalVolume(
const pa_cvolume* nVol);
53 pa_stream* GetInternalStream();
54 pa_threaded_mainloop* GetInternalMainLoop();
55 CCriticalSection m_sec;
56 std::atomic<int> m_requestedBytes = 0;
59 void Pause(
bool pause);
60 static inline bool WaitForOperation(pa_operation *op, pa_threaded_mainloop *mainloop,
const char *LogEntry);
64 bool m_IsStreamPaused;
67 unsigned int m_BytesPerSecond;
68 unsigned int m_BufferSize;
69 unsigned int m_Channels;
74 bool m_volume_needs_update;
75 uint32_t m_periodSize;
77 pa_context *m_Context;
78 pa_threaded_mainloop *m_MainLoop;
80 static std::unique_ptr<CDriverMonitor> m_pMonitor;
Definition: AESinkPULSE.cpp:24
unsigned int AddPackets(uint8_t **data, unsigned int frames, unsigned int offset) override
Adds packets to be sent out, this routine MUST block or sleep.
Definition: AESinkPULSE.cpp:1078
Definition: AESinkPULSE.h:26