Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java

Issue 1998483003: General cleanup on AppRTC Android Demo codebase (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove unused string that was accidentally added. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 } 63 }
64 }; 64 };
65 65
66 @Override 66 @Override
67 public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 67 public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
68 if (progress == 0) { 68 if (progress == 0) {
69 width = 0; 69 width = 0;
70 height = 0; 70 height = 0;
71 framerate = 0; 71 framerate = 0;
72 captureFormatText.setText("Muted"); 72 captureFormatText.setText(R.string.muted);
73 return; 73 return;
74 } 74 }
75 75
76 // Extract max bandwidth (in millipixels / second). 76 // Extract max bandwidth (in millipixels / second).
77 long maxCaptureBandwidth = java.lang.Long.MIN_VALUE; 77 long maxCaptureBandwidth = java.lang.Long.MIN_VALUE;
78 for (CaptureFormat format : formats) { 78 for (CaptureFormat format : formats) {
79 maxCaptureBandwidth = Math.max(maxCaptureBandwidth, 79 maxCaptureBandwidth = Math.max(maxCaptureBandwidth,
80 (long) format.width * format.height * format.maxFramerate); 80 (long) format.width * format.height * format.maxFramerate);
81 } 81 }
82 82
(...skipping 22 matching lines...) Expand all
105 callEvents.onCaptureFormatChange(width, height, framerate); 105 callEvents.onCaptureFormatChange(width, height, framerate);
106 } 106 }
107 107
108 // Return the highest frame rate possible based on bandwidth and format. 108 // Return the highest frame rate possible based on bandwidth and format.
109 private int calculateFramerate(double bandwidth, CaptureFormat format) { 109 private int calculateFramerate(double bandwidth, CaptureFormat format) {
110 return (int) Math.round(Math.min(format.maxFramerate, 110 return (int) Math.round(Math.min(format.maxFramerate,
111 (int) Math.round(bandwidth / (format.width * format.height))) / 1000.0); 111 (int) Math.round(bandwidth / (format.width * format.height))) / 1000.0);
112 } 112 }
113 } 113 }
114 114
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698