Mario
07/08/2025, 8:09 AMAVCaptureVideoDataOutputSampleBufferDelegateProtocol
because both its method definitions are the same, just with different names:
public expect interface AVCaptureVideoDataOutputSampleBufferDelegateProtocol : platform.darwin.NSObjectProtocol {
@kotlin.commonizer.ObjCCallable @kotlinx.cinterop.ObjCMethod public open expect fun captureOutput(output: platform.AVFoundation.AVCaptureOutput, didOutputSampleBuffer: kotlinx.cinterop.CPointer<cnames.structs.opaqueCMSampleBuffer>? /* from: platform.CoreMedia.CMSampleBufferRef? */, fromConnection: platform.AVFoundation.AVCaptureConnection): kotlin.Unit { /* compiled code */ }
@kotlin.commonizer.ObjCCallable @kotlinx.cinterop.ObjCMethod public open expect fun captureOutput(output: platform.AVFoundation.AVCaptureOutput, didDropSampleBuffer: kotlinx.cinterop.CPointer<cnames.structs.opaqueCMSampleBuffer>? /* from: platform.CoreMedia.CMSampleBufferRef? */, fromConnection: platform.AVFoundation.AVCaptureConnection): kotlin.Unit { /* compiled code */ }
}
When I try to implement it, I get the following error:
object : NSObject(), AVCaptureVideoDataOutputSampleBufferDelegateProtocol {
override fun captureOutput(
output: AVCaptureOutput,
didOutputSampleBuffer: CMSampleBufferRef?,
fromConnection: AVCaptureConnection
) {
super.captureOutput(output, didOutputSampleBuffer, fromConnection)
}
}
The corresponding parameter in the supertype 'AVCaptureVideoDataOutputSampleBufferDelegateProtocol' is named 'didDropSampleBuffer'. This may cause problems when calling this function with named arguments.
Darron Schall
07/08/2025, 3:45 PMMario
07/08/2025, 4:29 PM