MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / AlsaWorkerThread

Class AlsaWorkerThread

include/sound-capture/linux/SoundCaptureLinux.h:38–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36typedef snd_pcm_sframes_t (*snd_pcm_avail_update_fun)(snd_pcm_t* pcm);
37
38class AlsaWorkerThread : public QThread
39{
40 Q_OBJECT
41
42 std::atomic<bool> _exitNow{ false };
43 Logger* _logger;
44 QString _device;
45 SoundCapture* _parent;
46
47 void run() override;
48
49 public:
50 AlsaWorkerThread(Logger* logger, QString device, SoundCapture* parent);
51 void exitNow();
52
53 private:
54 bool initAlsaLib();
55 void closeAlsaLib();
56
57 void* _library = nullptr;
58 snd_pcm_open_fun snd_pcm_open = nullptr;
59 snd_pcm_hw_params_malloc_fun snd_pcm_hw_params_malloc = nullptr;
60 snd_pcm_hw_params_any_fun snd_pcm_hw_params_any = nullptr;
61 snd_pcm_hw_params_set_access_fun snd_pcm_hw_params_set_access = nullptr;
62 snd_pcm_hw_params_set_format_fun snd_pcm_hw_params_set_format = nullptr;
63 snd_pcm_hw_params_set_rate_near_fun snd_pcm_hw_params_set_rate_near = nullptr;
64 snd_pcm_hw_params_set_channels_fun snd_pcm_hw_params_set_channels = nullptr;
65 snd_pcm_hw_params_set_period_size_near_fun snd_pcm_hw_params_set_period_size_near = nullptr;
66 snd_pcm_hw_params_set_buffer_size_near_fun snd_pcm_hw_params_set_buffer_size_near = nullptr;
67 snd_pcm_hw_params_fun snd_pcm_hw_params = nullptr;
68 snd_pcm_state_fun snd_pcm_state = nullptr;
69 snd_pcm_start_fun snd_pcm_start = nullptr;
70 snd_pcm_hw_params_free_fun snd_pcm_hw_params_free = nullptr;
71 snd_pcm_wait_fun snd_pcm_wait = nullptr;
72 snd_pcm_readi_fun snd_pcm_readi = nullptr;
73 snd_pcm_prepare_fun snd_pcm_prepare = nullptr;
74 snd_pcm_drop_fun snd_pcm_drop = nullptr;
75 snd_pcm_hw_free_fun snd_pcm_hw_free = nullptr;
76 snd_pcm_close_fun snd_pcm_close = nullptr;
77 snd_config_update_free_global_fun snd_config_update_free_global = nullptr;
78 snd_strerror_fun snd_strerror = nullptr;
79 snd_pcm_avail_update_fun snd_pcm_avail_update = nullptr;
80};
81
82class SoundCaptureLinux : public SoundCapture
83{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected