AVCaptureAudioDataOutputSampleBufferDelegate

Trait AVCaptureAudioDataOutputSampleBufferDelegate 

Source
pub unsafe trait AVCaptureAudioDataOutputSampleBufferDelegate: NSObjectProtocol {
    // Provided method
    unsafe fn captureOutput_didOutputSampleBuffer_fromConnection(
        &self,
        output: &AVCaptureOutput,
        sample_buffer: &CMSampleBuffer,
        connection: &AVCaptureConnection,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature AVCaptureAudioDataOutput only.
Expand description

Defines an interface for delegates of AVCaptureAudioDataOutput to receive captured audio sample buffers.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn captureOutput_didOutputSampleBuffer_fromConnection( &self, output: &AVCaptureOutput, sample_buffer: &CMSampleBuffer, connection: &AVCaptureConnection, )
where Self: Sized + Message,

Available on crate features 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.

Trait Implementations§

Source§

impl ProtocolType for dyn AVCaptureAudioDataOutputSampleBufferDelegate

Source§

const NAME: &'static str = "AVCaptureAudioDataOutputSampleBufferDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn AVCaptureAudioDataOutputSampleBufferDelegate

Implementations on Foreign Types§

Source§

impl<T> AVCaptureAudioDataOutputSampleBufferDelegate for ProtocolObject<T>

Implementors§