Quickblox 如何使用setCustomVideoChatCaptureSession进行视频聊天?

Quickblox 如何使用setCustomVideoChatCaptureSession进行视频聊天?,quickblox,Quickblox,我需要为QuickBlox视频聊天应用视频或auido过滤器。有人对此有可用的示例代码吗 如何为此使用setCustomVideoChatCaptureSession和processVideoChatCaptureVideoSample?您可以在应用程序中使用自己的AVCaptureSession对象,并将所有视频数据包转发到SDK。所以SDK只发送数据包而不进行任何处理。这是一种方式 - (void)setup{ // Create video Chat QBVideoChat

我需要为QuickBlox视频聊天应用视频或auido过滤器。有人对此有可用的示例代码吗


如何为此使用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:方法并根据需要处理内容