pub unsafe trait AVCaptureAudioDataOutputSampleBufferDelegate: NSObjectProtocol {
// Provided method
unsafe fn captureOutput_didOutputSampleBuffer_fromConnection(
&self,
output: &AVCaptureOutput,
sample_buffer: &CMSampleBuffer,
connection: &AVCaptureConnection,
)
where Self: Sized + Message { ... }
}AVCaptureAudioDataOutput only.Expand description
Defines an interface for delegates of AVCaptureAudioDataOutput to receive captured audio sample buffers.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn captureOutput_didOutputSampleBuffer_fromConnection(
&self,
output: &AVCaptureOutput,
sample_buffer: &CMSampleBuffer,
connection: &AVCaptureConnection,
)
Available on crate features AVCaptureOutputBase and AVCaptureSession and objc2-core-media only.
unsafe fn captureOutput_didOutputSampleBuffer_fromConnection( &self, output: &AVCaptureOutput, sample_buffer: &CMSampleBuffer, connection: &AVCaptureConnection, )
AVCaptureOutputBase and AVCaptureSession and objc2-core-media only.Called whenever an AVCaptureAudioDataOutput instance outputs a new audio sample buffer.
Parameter output: The AVCaptureAudioDataOutput instance that output the samples.
Parameter sampleBuffer: A CMSampleBuffer object containing the audio samples and additional information about them, such as their format and presentation time.
Parameter connection: The AVCaptureConnection from which the audio was received.
Delegates receive this message whenever the output captures and outputs new audio samples, decoding or re-encoding as specified by the audioSettings property. Delegates can use the provided sample buffer in conjunction with other APIs for further processing. This method will be called on the dispatch queue specified by the output’s sampleBufferCallbackQueue property. This method is called periodically, so it must be efficient to prevent capture performance problems, including dropped audio samples.
Clients that need to reference the CMSampleBuffer object outside of the scope of this method must CFRetain it and then CFRelease it when they are finished with it.