AnyChat技术支持论坛

标题: AnyChat 音频、视频数据回调事件协议 [打印本页]

作者: kang    时间: 2016-6-3 11:35
标题: AnyChat 音频、视频数据回调事件协议
AnyChat 音频、视频数据回调事件协议在什么情况下  会打印数据      


作者: 佰锐科技-闫洪亮    时间: 2016-6-3 15:38
您好,我们的视频数据回调函数是BRAC_VideoData_CallBack,您可以在回调函数里对视频数据进行处理。
作者: kang    时间: 2016-6-3 17:12
佰锐科技-闫洪亮 发表于 2016-6-3 15:38
您好,我们的视频数据回调函数是BRAC_VideoData_CallBack,您可以在回调函数里对视频数据进行处理。

在你们AnyChatFeatures这个demo里面,这个方法没有走啊
// 视频数据回调
- (void) OnAnyChatVideoDataExCallBackint) dwUserid : (NSData*) lpBuf : (BITMAPINFOHEADER) bmiHeader : (int) dwTimeStamp
{
    /* Log var*/
//    NSLog(@"\n\n 视频数据回调 \n  dwUserid:%d  \n  wxh=%d x %d \n  size:%d \n dwTimeStamp:%i \n",dwUserid,bmiHeader.biWidth,bmiHeader.biHeight,(int)sizeof(bmiHeader),dwTimeStamp);
   
   
    // 通过(NSData*) lpBuf 返回的数据 绘制成 图片
    /*Get information about the image*/
    uint8_t *baseAddress = (uint8_t *)[lpBuf bytes];    // (NSData*) lpBuf 参数通过 [NSData bytes] 方法取地址
    size_t bytesPerRow = bmiHeader.biWidth*4;   // RGB32 = pixel size = 4 CVPixelBufferGetBytesPerRow(imageBuffer);
   
    /*Create a CGImageRef from the CVImageBufferRef*/
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGContextRef newContext = CGBitmapContextCreate(baseAddress, bmiHeader.biWidth, bmiHeader.biHeight, 8, bytesPerRow, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst);
    CGImageRef newImage = CGBitmapContextCreateImage(newContext);
   
    /*We release some components*/
    CGContextRelease(newContext);
    CGColorSpaceRelease(colorSpace);
   
    /*We display the result on the image view (We need to change the orientation of the image so that the video is displayed correctly).
     Same thing as for the CALayer we are not in the main thread so ...UIImageOrientationRight */
    UIImageOrientation imageOrientation = UIImageOrientationUp;
    UIImage *image= [UIImage imageWithCGImage:newImage scale:1.0 orientation:imageOrientation];
   
    /*We relase the CGImageRef*/
    CGImageRelease(newImage);

}




欢迎光临 AnyChat技术支持论坛 (http://bbs.anychat.cn/) Powered by Discuz! X3