private void CheckEncryptionStatus() { EVStatsCli mediaStats = new EVStatsCli(); EVSdkManager.Instance.GetStats(ref mediaStats); if (mediaStats.size > 0) { EncryptionVisibility = mediaStats.stats[0].is_encrypted ? Visibility.Visible : Visibility.Collapsed; } else { EncryptionVisibility = Visibility.Collapsed; } log.InfoFormat("EncryptionVisibility: {0}", EncryptionVisibility); }
public ActionResult GetStatistics() { if (CallStatus.Connected != CallController.Instance.CurrentCallStatus) { return(GetErrInfo(Constants.ErrorCode.NO_CONFERENCE)); } EVStatsCli mediaStats = new EVStatsCli(); EVSdkManager.Instance.GetStats(ref mediaStats); StatisticsInfo statisticsInfo = new StatisticsInfo(); statisticsInfo.statistics = new CallStatistics(); statisticsInfo.statistics.media_statistics = new MediaStatistics(); statisticsInfo.statistics.media_statistics.ar = new List <StreamStatus>(); statisticsInfo.statistics.media_statistics.@as = new List <StreamStatus>(); statisticsInfo.statistics.media_statistics.cr = new List <StreamStatus>(); statisticsInfo.statistics.media_statistics.cs = new List <StreamStatus>(); statisticsInfo.statistics.media_statistics.pr = new List <StreamStatus>(); statisticsInfo.statistics.media_statistics.ps = new List <StreamStatus>(); for (var i = 0; i < mediaStats.size; ++i) { EVStreamStatsCli streamStats = mediaStats.stats[i]; var restStatus = new StreamStatus() { codec = null != streamStats.payload_type ? streamStats.payload_type : "", resolution = EV_STREAM_TYPE_CLI.EV_STREAM_AUDIO == streamStats.type ? "" : streamStats.resolution.width + "x" + streamStats.resolution.height, //pipeName = "AR", packetLost = streamStats.cum_packet_loss, packetLostRate = streamStats.packet_loss_rate, jitter = 0, frameRate = EV_STREAM_TYPE_CLI.EV_STREAM_AUDIO == streamStats.type ? 0 : (int)streamStats.fps, encrypted = streamStats.is_encrypted, rtp_actualBitRate = (int)streamStats.real_bandwidth, rtp_settingBitRate = (int)streamStats.nego_bandwidth, totalPacket = streamStats.cum_packet }; switch (streamStats.type) { case EV_STREAM_TYPE_CLI.EV_STREAM_AUDIO: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { restStatus.pipeName = "AR"; statisticsInfo.statistics.media_statistics.ar.Add(restStatus); } else { restStatus.pipeName = "AS"; [email protected](restStatus); } break; case EV_STREAM_TYPE_CLI.EV_STREAM_VIDEO: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { restStatus.pipeName = "PR"; statisticsInfo.statistics.media_statistics.pr.Add(restStatus); } else { restStatus.pipeName = "PS"; statisticsInfo.statistics.media_statistics.ps.Add(restStatus); } break; case EV_STREAM_TYPE_CLI.EV_STREAM_CONTENT: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { restStatus.pipeName = "CR"; statisticsInfo.statistics.media_statistics.cr.Add(restStatus); } else { restStatus.pipeName = "CS"; statisticsInfo.statistics.media_statistics.cs.Add(restStatus); } break; case EV_STREAM_TYPE_CLI.EV_STREAM_WHITE_BOARD: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { restStatus.pipeName = "CR"; statisticsInfo.statistics.media_statistics.cr.Add(restStatus); } else { restStatus.pipeName = "CS"; statisticsInfo.statistics.media_statistics.cs.Add(restStatus); } break; } } statisticsInfo.statistics.signal_statistics = new SignalStatistics() { call_type = "SVC", call_rate = SettingManager.Instance.GetCurrentCallRate(), call_index = 0 }; return(Json(statisticsInfo)); }
private void OnTimerRefreshMediaStatistics(object source, ElapsedEventArgs e) { string notEncrypted = LanguageUtil.Instance.GetValueByKey("NOT_ENCRYPTED"); string encrypted = LanguageUtil.Instance.GetValueByKey("ENCRYPTED"); EVStatsCli mediaStats = new EVStatsCli(); EVSdkManager.Instance.GetStats(ref mediaStats); List <MediaStatisticsItem> tempList = new List <MediaStatisticsItem>(); for (int i = 0; i < mediaStats.size; ++i) { EVStreamStatsCli streamStats = mediaStats.stats[i]; MediaStatisticsItem item = new MediaStatisticsItem() { Codec = null != streamStats.payload_type ? streamStats.payload_type : "", LineRate = streamStats.nego_bandwidth.ToString(), ActualLineRate = ((int)Math.Ceiling(streamStats.real_bandwidth)).ToString(), Resolution = EV_STREAM_TYPE_CLI.EV_STREAM_AUDIO == streamStats.type ? "-" : TranslateResolution(streamStats.resolution), FrameRate = EV_STREAM_TYPE_CLI.EV_STREAM_AUDIO == streamStats.type ? "-" : ((int)Math.Ceiling(streamStats.fps)).ToString(), PacketLossInfo = streamStats.cum_packet_loss.ToString() + "(" + Math.Round(streamStats.packet_loss_rate, 1).ToString() + "%)", Encrypted = streamStats.is_encrypted ? encrypted : notEncrypted }; switch (streamStats.type) { case EV_STREAM_TYPE_CLI.EV_STREAM_AUDIO: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("AUDIO_RECEPTION"); } else { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("AUDIO_SENDING"); } break; case EV_STREAM_TYPE_CLI.EV_STREAM_VIDEO: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("VIDEO_RECEPTION"); } else { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("VIDEO_SENDING"); } break; case EV_STREAM_TYPE_CLI.EV_STREAM_CONTENT: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("CONTENT_RECEPTION"); } else { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("CONTENT_SENDING"); } break; case EV_STREAM_TYPE_CLI.EV_STREAM_WHITE_BOARD: if (EV_STREAM_DIR_CLI.EV_STREAM_DOWNLOAD == streamStats.dir) { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("WHITE_BOARD_RECEPTION"); } else { item.MediaOrientation = LanguageUtil.Instance.GetValueByKey("WHITE_BOARD_SENDING"); } break; } tempList.Add(item); } MediaStatisticsItemList = tempList; }