No. You shouldn't call any objective-c in the dsp code either. Your dsp code shouldn't allocate any memory. Neither Swift or Obj-C can guarantee that memory is not allocated when a method is called.
Post
Replies
Boosts
Views
Activity
The contract isn't that the I/O Proc won't get called again after AudioOutputUnitStop is called, it is that it won't be called again after AudioOutputUnitStop returns. These aren't the same thing.
If you call AudioOutputUnitStop from the I/O Proc then the I/O Proc will not be called again.
To answer your question: I am instantiating AVMutableCaption, modifying it and then supplying it to the AVCaptionRenderer. I am just using a playground right now, so each run is a new caption and renderer. The caption is not modified or used after renderer.
I was able to get backgroundColor and fontStyle to work.
AVCaptionRenderer - Modifying the render bounds has very unexpected results. I expect that the text is rendered in the supplied bounds. Instead the text seems to always be rendered at (0,0).
AVMutableCaption.setFontWeight has no effect.
AVMutableCaption.setDecoration(.lineThrough, ...) has no effect.
AVMutableCaption.textAlignment has no effect.
Changing the AVMutableCaption.region causes the text to not render at all.
I can supply some playgrounds that demonstrate these problems if you like.
AVCaptionRenderer is probably the most sparsely documented API I have ever seen. I can't imagine that it is actually being used by anybody in it's current state.
I filed a bug for this in 2015. The ticket was closed with "There are no plans to address this. We are now closing this report."
Part of my bug report was a request to at the very least update the documentation to indicate that this property is no longer supported. Imagine my shock to find out that 5 years later this still hasn't been properly addressed.