SINVideoFrameCallback
Objective-C
@protocol SINVideoFrameCallback <NSObject>
Swift
protocol SINVideoFrameCallback : NSObjectProtocol
Video frame handler must adopt SINVideoFrameCallback protocol
-
Callback handler that can be used to post-process video frames.
Important
The callback handler implementation must retain the input CVPixelBuffer object using CVPixelBufferRetain, and release it after invoking the completion handler, using CVPixelBufferRelease.
Important
Invoking the
completionHandler
is mandatory.Declaration
Objective-C
- (void)onFrame:(CVPixelBufferRef)cvPixelBuffer completionHandler:(void (^)(CVPixelBufferRef))completionHandler;
Swift
func onFrame(_ cvPixelBuffer: CVPixelBuffer!, completionHandler: ((CVPixelBuffer?) -> Void)!)
Parameters
cvPixelBuffer
The raw video frame buffer.
completionHandler
Completion handler block, to be invoked with processed output pixel buffer as argument.