MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / on_destroy_node_proxy

Function on_destroy_node_proxy

src/audio/pipewire/PwPipelineManager.cpp:161–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void on_destroy_node_proxy(void* data) {
162 auto* const nd = static_cast<node_data*>(data);
163
164 auto* const pm = nd->pm;
165
166 auto node_it = pm->node_map.find(nd->nd_info->serial);
167
168 if (node_it == pm->node_map.end()) {
169 return;
170 }
171
172 nd->nd_info->proxy = nullptr;
173
174 node_it->second.proxy = nullptr;
175
176 spa_hook_remove(&nd->proxy_listener);
177
178 pm->node_map.erase(node_it);
179
180 if (!PwPipelineManager::exiting) {
181 if (nd->nd_info->media_class == tags::pipewire::media_class::source) {
182 const auto nd_info_copy = *nd->nd_info;
183
184 util::idle_add([=]() {
185 if (PwPipelineManager::exiting) {
186 return;
187 }
188
189 pm->source_removed.emit(nd_info_copy);
190 });
191 } else if (nd->nd_info->media_class == tags::pipewire::media_class::sink) {
192 const auto nd_info_copy = *nd->nd_info;
193
194 util::idle_add([=]() {
195 if (PwPipelineManager::exiting) {
196 return;
197 }
198
199 pm->sink_removed.emit(nd_info_copy);
200 });
201 } else if (nd->nd_info->media_class == tags::pipewire::media_class::output_stream) {
202 const auto serial = nd->nd_info->serial;
203
204 util::idle_add([=]() {
205 if (PwPipelineManager::exiting) {
206 return;
207 }
208
209 pm->stream_output_removed.emit(serial);
210 });
211 } else if (nd->nd_info->media_class == tags::pipewire::media_class::input_stream) {
212 const auto serial = nd->nd_info->serial;
213
214 util::idle_add([=]() {
215 if (PwPipelineManager::exiting) {
216 return;
217 }
218

Callers

nothing calls this directly

Calls 3

to_stringFunction · 0.85
eraseMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected