/// <summary> /// 设置回调 /// </summary> /// <param name="streamClientCallBack"> 回调委托 </param> /// <returns></returns> public KeyValuePair <bool, string> SetCallback(EasyStreamClientCallBack streamClientCallBack) { try { this.StreamClientCallBack = streamClientCallBack; int ret = EasyStreamClient_SetCallback(this.StreamClientHandle, this.StreamClientCallBack); if (ret != 0) { return(new KeyValuePair <bool, string>(false, string.Format("设置回调失败,错误代码:{0}", ret))); } else { return(new KeyValuePair <bool, string>(true, "设置回调成功!")); } } catch (Exception ex) { return(new KeyValuePair <bool, string>(false, string.Format("EasyStreamClient 设置回调失败,异常消息:{0}", ex.Message))); } }
private static extern int EasyStreamClient_SetCallback(IntPtr handle, EasyStreamClientCallBack callback);