Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
audio_workgroup_client.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace pulp::format {
6
12public:
26 virtual void set_audio_workgroup(void* workgroup) noexcept = 0;
27
38 void* workgroup) noexcept {
39 set_audio_workgroup(workgroup);
40 }
41
45 virtual bool prepare_audio_workgroup_for_render() noexcept { return true; }
46
50 virtual void wait_for_audio_workgroup_update() noexcept = 0;
51
52protected:
54};
55
59 audio::AudioDevice* device) {
60 if (device) {
61 device->set_workgroup_change_callback(
62 [&client](void* workgroup) {
63 client.set_audio_workgroup(workgroup);
64 if (!workgroup) client.wait_for_audio_workgroup_update();
65 });
66 } else {
67 client.set_audio_workgroup(nullptr);
68 }
69}
70
75 AudioWorkgroupClient* client, audio::AudioDevice& device) noexcept {
76 // A live device can still be finishing a retarget after an earlier null
77 // publication. Disable future changes and drain that in-flight publication
78 // before the final explicit removal and close.
79 device.quiesce_workgroup_changes();
80 if (client) {
81 client->set_audio_workgroup(nullptr);
82 client->wait_for_audio_workgroup_update();
83 }
84 device.close();
85}
86
91 AudioWorkgroupClient* client) noexcept {
92 if (!client) return;
93 client->set_audio_workgroup_from_render_context(nullptr);
94 client->wait_for_audio_workgroup_update();
95}
96
97} // namespace pulp::format
Definition device.hpp:70
Optional capability for processors and graph runtimes which own auxiliary realtime rendering threads.
Definition audio_workgroup_client.hpp:11
virtual void set_audio_workgroup_from_render_context(void *workgroup) noexcept
Publish an AU render-context workgroup.
Definition audio_workgroup_client.hpp:37
virtual void set_audio_workgroup(void *workgroup) noexcept=0
Publish the device-owned workgroup for subsequent renders, or null when the standalone device has no ...
virtual void wait_for_audio_workgroup_update() noexcept=0
Off-RT barrier for borrowed-handle teardown.
virtual bool prepare_audio_workgroup_for_render() noexcept
RT-safe render-cycle preparation.
Definition audio_workgroup_client.hpp:45
Definition analyzer_provider.hpp:12
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition aax_editor.hpp:31
void clear_audio_workgroup_after_render_resources(AudioWorkgroupClient *client) noexcept
Off-RT AU resource teardown.
Definition audio_workgroup_client.hpp:90
void close_audio_device_after_workgroup_release(AudioWorkgroupClient *client, audio::AudioDevice &device) noexcept
Stop-time ownership barrier: release the device-owned handle on every worker before close() can inval...
Definition audio_workgroup_client.hpp:74
void bind_audio_device_workgroup(AudioWorkgroupClient &client, audio::AudioDevice *device)
Production device-to-renderer handoff shared by standalone and timeline hosts.
Definition audio_workgroup_client.hpp:58