Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::AudioWorkgroupClient Class Referenceabstract

Optional capability for processors and graph runtimes which own auxiliary realtime rendering threads. More...

#include <audio_workgroup_client.hpp>

Public Member Functions

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 workgroup / removes its current one.
virtual void set_audio_workgroup_from_render_context (void *workgroup) noexcept
 Publish an AU render-context workgroup.
virtual bool prepare_audio_workgroup_for_render () noexcept
 RT-safe render-cycle preparation.
virtual void wait_for_audio_workgroup_update () noexcept=0
 Off-RT barrier for borrowed-handle teardown.

Protected Member Functions

 ~AudioWorkgroupClient ()=default

Detailed Description

Optional capability for processors and graph runtimes which own auxiliary realtime rendering threads.

This stays separate from Processor so opting in does not widen the node ABI.

Constructor & Destructor Documentation

◆ ~AudioWorkgroupClient()

pulp::format::AudioWorkgroupClient::~AudioWorkgroupClient ( )
protecteddefault

Member Function Documentation

◆ prepare_audio_workgroup_for_render()

virtual bool pulp::format::AudioWorkgroupClient::prepare_audio_workgroup_for_render ( )
inlinevirtualnoexcept

RT-safe render-cycle preparation.

Every worker completes the transition; false means at least one new join failed and the caller must render inline for this publication.

Reimplemented in pulp::host::SignalGraph.

◆ set_audio_workgroup()

virtual void pulp::format::AudioWorkgroupClient::set_audio_workgroup ( void * workgroup)
pure virtualnoexcept

Publish the device-owned workgroup for subsequent renders, or null when the standalone device has no workgroup / removes its current one.

A null device publication preserves the worker pool's best-effort priority fallback. The publisher for one client must be serialized (CoreAudio serializes device changes). This may run on the realtime thread and must not allocate, lock, block, retain/release Objective-C/os objects, or call host APIs.

AU lifetime follows Apple's render-context protocol: the context struct is callback-scoped, while its workgroup is the host-owned current render context that auxiliary realtime threads are instructed to join and leave when the next observer publication arrives. Standalone devices hold a caller-owned query reference until the explicit teardown barrier below.

Implemented in pulp::host::SignalGraph.

◆ set_audio_workgroup_from_render_context()

virtual void pulp::format::AudioWorkgroupClient::set_audio_workgroup_from_render_context ( void * workgroup)
inlinevirtualnoexcept

Publish an AU render-context workgroup.

Null is an explicit context removal and must not select the standalone no-workgroup fallback. Apple does not document os_retain/os_release as RT-safe and supplies no completion callback by which a host can know a late asynchronous join no longer references the previous context. Pulp therefore adopts it in a synchronous observer barrier: every worker, including cold sleepers, completes leave of the old context and acknowledges its new join result before the observer returns.

Reimplemented in pulp::host::SignalGraph.

◆ wait_for_audio_workgroup_update()

virtual void pulp::format::AudioWorkgroupClient::wait_for_audio_workgroup_update ( )
pure virtualnoexcept

Off-RT barrier for borrowed-handle teardown.

Returns only after every auxiliary worker has acknowledged the most recently published value. Never call this from an audio callback or AU render-context observer.

Implemented in pulp::host::SignalGraph.


The documentation for this class was generated from the following file: