2013-08-05 35 views

回答

0

您可以在您的應用程序中使用自己的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:方法和處理內容,只要你想