Java Code Examples for org.webrtc.StatsReport#Value

The following examples show how to use org.webrtc.StatsReport#Value . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HudFragment.java    From Yahala-Messenger with MIT License 5 votes vote down vote up
private Map<String, String> getReportMap(StatsReport report) {
    Map<String, String> reportMap = new HashMap<String, String>();
    for (StatsReport.Value value : report.values) {
        reportMap.put(value.name, value.value);
    }
    return reportMap;
}
 
Example 2
Source File: WebRTCActivity.java    From voip_android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private Map<String, String> getReportMap(StatsReport report) {
    Map<String, String> reportMap = new HashMap<String, String>();
    for (StatsReport.Value value : report.values) {
        reportMap.put(value.name, value.value);
    }
    return reportMap;
}
 
Example 3
Source File: AppRTCDemoActivity.java    From WebRTCDemo with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void updateHUD(StatsReport[] reports) {
  StringBuilder builder = new StringBuilder();
  for (StatsReport report : reports) {
    // bweforvideo to show statistics for video Bandwidth Estimation,
    // which is global per-session.
    if (report.id.equals("bweforvideo")) {
      for (StatsReport.Value value : report.values) {
        String name = value.name.replace("goog", "")
            .replace("Available", "").replace("Bandwidth", "")
            .replace("Bitrate", "").replace("Enc", "");

        builder.append(name).append("=").append(value.value)
            .append(" ");
      }
      builder.append("\n");
    } else if (report.type.equals("googCandidatePair")) {
      String activeConnectionStats = getActiveConnectionStats(report);
      if (activeConnectionStats == null) {
        continue;
      }
      builder.append(activeConnectionStats);
    } else {
      continue;
    }
    builder.append("\n");
  }
  hudView.setText(builder.toString() + hudView.getText());
}
 
Example 4
Source File: AppRTCDemoActivity.java    From droidkit-webrtc with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void updateHUD(StatsReport[] reports) {
  StringBuilder builder = new StringBuilder();
  for (StatsReport report : reports) {
    if (!report.id.equals("bweforvideo")) {
      continue;
    }
    for (StatsReport.Value value : report.values) {
      String name = value.name.replace("goog", "").replace("Available", "")
          .replace("Bandwidth", "").replace("Bitrate", "").replace("Enc", "");
      builder.append(name).append("=").append(value.value).append(" ");
    }
    builder.append("\n");
  }
  hudView.setText(builder.toString() + hudView.getText());
}