コード例 #1
0
ファイル: NIMRtsAPI.cs プロジェクト: zanjs/Wawaji
        /// <summary>
        /// 回复收到的邀请
        /// </summary>
        /// <param name="sessionId">会话id</param>
        /// <param name="channelType">通道类型,暂时无效</param>
        /// <param name="accept">是否接受</param>
        /// <param name="info">接受时的发起信息扩展参数</param>
        /// <param name="ackResHandler">结果回调</param>
        public static void Ack(string sessionId, NIMRtsChannelType channelType, bool accept, NIMRts.RtsStartInfo info, NIMRts.AckResHandler ackResHandler)
        {
            var ptr  = NimUtility.DelegateConverter.ConvertToIntPtr(ackResHandler);
            var json = info == null ? null: info.Serialize();

            NIMRts.RtsNativeMethods.nim_rts_ack(sessionId, (int)channelType, accept, json, AckResCb, ptr);
        }
コード例 #2
0
ファイル: NIMRtsAPI.cs プロジェクト: zanjs/Wawaji
        /// <summary>
        /// 创建rts会话
        /// </summary>
        /// <param name="channelType">通道类型 如要tcp+音视频,则channel_type=kNIMRtsChannelTypeTcp|kNIMRtsChannelTypeVchat,同时整个SDK只允许一个音视频通道存在(包括vchat)</param>
        /// <param name="uid">对方帐号</param>
        /// <param name="info">发起扩展参数</param>
        /// <param name="startResHandler">结果回调</param>
        public static void Start(NIMRtsChannelType channelType, string uid, NIMRts.RtsStartInfo info, NIMRts.StartResHandler startResHandler)
        {
            var ptr  = NimUtility.DelegateConverter.ConvertToIntPtr(startResHandler);
            var json = info.Serialize();

            NIMRts.RtsNativeMethods.nim_rts_start((int)channelType, uid, json, StartResCb, ptr);
        }
コード例 #3
0
        /// <summary>
        ///     发送数据,暂时支持tcp通道,建议发送频率在20Hz以下
        /// </summary>
        /// <param name="sessionId">会话id</param>
        /// <param name="channelType">通道类型</param>
        /// <param name="data">发送数据</param>
        /// <param name="size">data的数据长度</param>
        /// <param name="info">RtsSendDataInfo 发送数据时的json封装类,默认为空</param>
        public static void SendData(string sessionId, NIMRtsChannelType channelType, IntPtr data, int size, RtsSendDataInfo info = null)
        {
            string json_extension = "";

            if (info != null)
            {
                json_extension = info.Serialize();
            }
            RtsNativeMethods.nim_rts_send_data(sessionId, (int)channelType, data, size, json_extension);
        }
コード例 #4
0
ファイル: NIMRtsAPI.cs プロジェクト: zanjs/Wawaji
 /// <summary>
 /// 发送数据,暂时支持tcp通道,建议发送频率在20Hz以下
 /// </summary>
 /// <param name="sessionId">会话id</param>
 /// <param name="channelType">通道类型</param>
 /// <param name="data">发送数据</param>
 /// <param name="size">data的数据长度</param>
 public static void SendData(string sessionId, NIMRtsChannelType channelType, IntPtr data, int size)
 {
     NIMRts.RtsNativeMethods.nim_rts_send_data(sessionId, (int)channelType, data, size, "");
 }