0
我需要爲QuickBlox視頻聊天應用視頻或音頻過濾器。任何人都有這樣的工作示例代碼?如何使用setCustomVideoChatCaptureSession進行視頻聊天?
如何使用setCustomVideoChatCaptureSession和processVideoChatCaptureVideoSample達到此目的?
我需要爲QuickBlox視頻聊天應用視頻或音頻過濾器。任何人都有這樣的工作示例代碼?如何使用setCustomVideoChatCaptureSession進行視頻聊天?
如何使用setCustomVideoChatCaptureSession和processVideoChatCaptureVideoSample達到此目的?
您可以在您的應用程序中使用自己的AVCaptureSession對象,並將所有視頻數據包轉發給SDK。所以SDK只會發送數據包而不做任何處理。這是一種方法。
- (void)setup{
// Create video Chat
QBVideoChat *videoChat = [[QBChat instance] createAndRegisterVideoChatInstance];
[videoChat setIsUseCustomVideoChatCaptureSession:YES];
// Create capture session
self.captureSession = [[AVCaptureSession alloc] init];
//
// ... setup capture session here
/*We create a serial queue to handle the processing of our frames*/
dispatch_queue_t callbackQueue= dispatch_queue_create("cameraQueue", NULL);
[videoCaptureOutput setSampleBufferDelegate:self queue:callbackQueue];
/*We start the capture*/
[self.captureSession startRunning];
}
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
// Do something with samples
// ...
// forward video samples to SDK
[videoChat processVideoChatCaptureVideoSample:sampleBuffer];
}
其他的方法是在接收端應用濾波器。只要覆蓋view.layer setContent:方法和處理內容,只要你想