/// <summary> /// 创建RTMP推送的参数信息 /// </summary> /// <param name="mediaInfo"> 流媒体信息 </param> /// <param name="bufferKSize"> 缓冲区大小 </param> /// <returns></returns> public KeyValuePair <bool, string> InitMetadata(EasyTypes.EASY_MEDIA_INFO_T mediaInfo, int bufferKSize = 1024) { if (!this.IsInit) { return(new KeyValuePair <bool, string>(false, "RTMP 未创建!")); } try { int ret = IsWindows ? EasyRTMP_InitMetadata_Win32(this.RtmpHandle, mediaInfo, bufferKSize) : EasyRTMP_InitMetadata_Linux(this.RtmpHandle, mediaInfo, bufferKSize); if (ret == 0) { this.IsInitMetadata = true; return(new KeyValuePair <bool, string>(true, "RTMP 创建媒体成功!")); } else { this.IsInitMetadata = false; return(new KeyValuePair <bool, string>(false, string.Format("RTMP 创建媒体失败,错误代码:{0}", ret))); } } catch (System.Exception e) { this.IsInitMetadata = false; return(new KeyValuePair <bool, string>(false, e.Message)); } }
private extern static int EasyRTMP_InitMetadata_Linux(IntPtr handle, EasyTypes.EASY_MEDIA_INFO_T pstruStreamInfo, int bufferKSize);