Add CpuMonitor to Android ApprtcDemo
R=magjed@webrtc.org, perkj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/38169004 Cr-Commit-Position: refs/heads/master@{#8444} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8444 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -59,6 +59,7 @@ public class CallFragment extends Fragment {
|
||||
private boolean displayHud;
|
||||
private volatile boolean isRunning;
|
||||
private TextView hudView;
|
||||
private final CpuMonitor cpuMonitor = new CpuMonitor();
|
||||
|
||||
/**
|
||||
* Call control interface for container activity.
|
||||
@@ -224,6 +225,15 @@ public class CallFragment extends Fragment {
|
||||
.append(actualBitrate)
|
||||
.append("\n");
|
||||
}
|
||||
|
||||
if (cpuMonitor.sampleCpuUtilization()) {
|
||||
stat.append("CPU%: ")
|
||||
.append(cpuMonitor.getCpuCurrent())
|
||||
.append("/")
|
||||
.append(cpuMonitor.getCpuAvg3())
|
||||
.append("/")
|
||||
.append(cpuMonitor.getCpuAvgAll());
|
||||
}
|
||||
encoderStatView.setText(stat.toString());
|
||||
hudView.setText(bweBuilder.toString() + hudView.getText());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user