AURenderContextObserver
A custom block that tells the audio unit which thread context to use for the next render cycle.
Declaration
typedef void (^)(const struct AudioUnitRenderContext *) __attribute__((nonblocking)) AURenderContextObserver;Mentioned in
Discussion
Provide this block if your Audio Unit creates its own auxiliary real-time rendering threads and operates them in parallel with the host app’s rendering thread. For a v3 Audio Unit, assign your block to the renderContextObserver property of your AUAudioUnit object. For a v2 Audio Unit, assign this block to the kAudioUnitProperty_RenderContextObserver property of the audio unit.
Use the implementation of your block to prepare your Audio Unit’s rendering threads. For example, use this block to remove the thread from its previous workgroup and join the new workgroup in the AudioUnitRenderContext structure passed to the block. If the new render context does not correspond to a real-time operation, the new workgroup might be NULL.
The system fetches and caches this block when it opens the Audio Unit. When the render context changes, the system calls the block from the render thread before it issues any new render requests.