示例#1
0
 /// <summary>
 /// 推送H264或AAC流
 /// </summary>
 /// <param name="frame"></param>
 /// <returns></returns>
 public KeyValuePair <bool, string> SendPacket(EasyTypes.EASY_AV_Frame frame)
 {
     if (!this.IsInit)
     {
         return(new KeyValuePair <bool, string>(false, "RTMP 未创建!"));
     }
     try
     {
         int ret = IsWindows ? EasyRTMP_SendPacket_Win32(this.RtmpHandle, frame) : EasyRTMP_SendPacket_Linux(this.RtmpHandle, frame);
         if (ret == 0)
         {
             return(new KeyValuePair <bool, string>(true, "发送流媒体数据包成功!"));
         }
         else
         {
             return(new KeyValuePair <bool, string>(true, "发送流媒体数据包失败!"));
         }
     }
     catch (System.Exception e)
     {
         return(new KeyValuePair <bool, string>(false, e.Message));
     }
 }
示例#2
0
 private extern static int EasyRTMP_SendPacket_Linux(IntPtr handle, EasyTypes.EASY_AV_Frame frame);