|
本帖最后由 hk92 于 2015-12-24 12:57 编辑
您好,我按照文档说明,进行外部视频的输入,但每次输入只有一帧。我的具体实现过程为:首先初始化SDK时,设置了外部视频输入模式。- //外部视频输入
- int bExtVideoInput = 1;
- AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_CORESDK_EXTVIDEOINPUT, ref bExtVideoInput, sizeof(int));
复制代码 在进入房间成功之后,设置了视频的数据格式- AnyChatCoreSDK.SetInputVideoFormat(AnyChatCoreSDK.PixelFormat.BRAC_PIX_FMT_YUV420P, 320, 240, 25, 0);
复制代码 在进入房间后我所进行的操作为- FileStream fs1 = new FileStream(@"D:\a.yuv", FileMode.Open);
- //获取文件大小
- int size = (int)fs1.Length;
- byte[] array = new byte[size];
- //将文件读到byte数组中
- fs1.Read(array, 0, array.Length);
-
- IntPtr buffer = Marshal.AllocHGlobal(array.Length);
- Marshal.Copy(array, 0, buffer, array.Length);
- fs1.Close();
- int roomid = m.WParam.ToInt32();
- Print("进入房间成功,房间编号为:" + roomid.ToString());
- m_RoomID = roomid;
- int ret = AnyChatCoreSDK.SetVideoPos(-1, pnl_local.Handle, 0, 0, pnl_local.Width, pnl_local.Height);
- //ret = AnyChatCoreSDK.UserCameraControl(-1, true);
-
- ret = AnyChatCoreSDK.InputVideoData(buffer, 320 *240 * 3, 0);
- MessageBox.Show(ret.ToString());
- ret = AnyChatCoreSDK.UserSpeakControl(-1, true);
复制代码 在这里,ret = AnyChatCoreSDK.InputVideoData(buffer, 320 *240 * 3, 0);ret的值是0;成功的,但是只显示了一帧就固定不动了,如果想要连续的显示出来,我该怎么解决呢? |
|