设为首页收藏本站

AnyChat技术支持论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 2800|回复: 2
打印 上一主题 下一主题

AnyChat 音频、视频数据回调事件协议

[复制链接]

2

主题

3

帖子

28

积分

新手上路

Rank: 1

积分
28
跳转到指定楼层
楼主
发表于 2016-6-3 11:35:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
AnyChat 音频、视频数据回调事件协议在什么情况下  会打印数据      

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

沙发
发表于 2016-6-3 15:38:04 | 只看该作者
您好,我们的视频数据回调函数是BRAC_VideoData_CallBack,您可以在回调函数里对视频数据进行处理。
回复 支持 反对

使用道具 举报

2

主题

3

帖子

28

积分

新手上路

Rank: 1

积分
28
板凳
 楼主| 发表于 2016-6-3 17:12:35 | 只看该作者
佰锐科技-闫洪亮 发表于 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);

}
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|AnyChat ( 粤ICP备13022410号-1 )  

GMT+8, 2024-4-20 04:11 , Processed in 0.110697 second(s), 21 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表