|
本帖最后由 佰锐科技-李永星 于 2015-8-5 17:06 编辑
您好,C#里面调用,你可以参考其它类同的回调方式,自己照着写一个。在BRAnyChatCoreSDK.cs里面AnyChat Platform Core SDK 功能函数API接口封装。把C++函数原型添加一个对应委托就可以了,其参数你可以仿照里面已有的进行转换。
- /// <summary>
- /// 视频事件注册
- /// </summary>
- /// <param name="format"></param>
- /// <param name="function"></param>
- /// <param name="userValue"></param>
- /// <returns></returns>
- [DllImport(AnyChatCoreSDKDll, EntryPoint = "BRAC_SetVideoDataCallBack", CallingConvention = CallingConvention.Cdecl)]
- public static extern int SetVideoDataCallBack(PixelFormat format, VideoData_CallBack function,int userValue);
- /// <summary>
- /// 视频扩展事件注册
- /// </summary>
- /// <param name="format"></param>
- /// <param name="function"></param>
- /// <param name="userValue"></param>
- /// <returns></returns>
- [DllImport(AnyChatCoreSDKDll, EntryPoint = "BRAC_SetVideoDataExCallBack", CallingConvention = CallingConvention.Cdecl)]
- public static extern int SetVideoDataExCallBack(PixelFormat format, VideoDataEx_CallBack function, int userValue);
复制代码-
- /// <summary>
- /// 视频回调函数
- /// </summary>
- /// <param name="userId"></param>
- /// <param name="buf"></param>
- /// <param name="len"></param>
- /// <param name="bitMap"></param>
- /// <param name="userValue"></param>
- public delegate void VideoData_CallBack(int userId, IntPtr buf, int len, BITMAPINFOHEADER bitMap, int userValue);
- /// <summary>
- /// 视频扩展回调函数
- /// </summary>
- /// <param name="userId"></param>
- /// <param name="buf"></param>
- /// <param name="len"></param>
- /// <param name="bitMap"></param>
- /// <param name="userValue"></param>
- public delegate void VideoDataEx_CallBack(int userId, IntPtr buf, int len, BITMAPINFOHEADER bitMap, int timestamp, int userValue);
复制代码 |
|