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

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

Issue 2066773002: Android: Add Size class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/java/jni/androidvideocapturer_jni.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java
index d231c41a1918645d301252c0c4b03df72f020aac..2804f0328d6d0ce439f807adefda8aa4cfa8b351 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java
@@ -55,7 +55,7 @@ public class CaptureQualityController implements SeekBar.OnSeekBarChangeListener
if (firstFps >= FRAMERATE_THRESHOLD && secondFps >= FRAMERATE_THRESHOLD
|| firstFps == secondFps) {
// Compare resolution.
- return first.width * first.height - second.width * second.height;
+ return first.size.width * first.size.height - second.size.width * second.size.height;
perkj_webrtc 2016/06/14 13:01:19 first.size.GetArea()- second.size.GetArea() ?
sakal 2016/06/14 13:12:51 Done.
} else {
// Compare fps.
return firstFps - secondFps;
@@ -77,7 +77,7 @@ public class CaptureQualityController implements SeekBar.OnSeekBarChangeListener
long maxCaptureBandwidth = java.lang.Long.MIN_VALUE;
for (CaptureFormat format : formats) {
maxCaptureBandwidth = Math.max(maxCaptureBandwidth,
- (long) format.width * format.height * format.framerate.max);
+ (long) format.size.width * format.size.height * format.framerate.max);
perkj_webrtc 2016/06/14 13:01:19 size.GetArea() ?
sakal 2016/06/14 13:12:51 Done.
}
// Fraction between 0 and 1.
@@ -90,8 +90,8 @@ public class CaptureQualityController implements SeekBar.OnSeekBarChangeListener
// Choose the best format given a target bandwidth.
final CaptureFormat bestFormat = Collections.max(formats, compareFormats);
- width = bestFormat.width;
- height = bestFormat.height;
+ width = bestFormat.size.width;
+ height = bestFormat.size.height;
framerate = calculateFramerate(targetBandwidth, bestFormat);
captureFormatText.setText(width + "x" + height + " @ " + framerate + "fps");
perkj_webrtc 2016/06/14 13:01:19 size.ToString on line 96 ?
sakal 2016/06/14 13:12:51 Done.
}
@@ -108,7 +108,7 @@ public class CaptureQualityController implements SeekBar.OnSeekBarChangeListener
// Return the highest frame rate possible based on bandwidth and format.
private int calculateFramerate(double bandwidth, CaptureFormat format) {
return (int) Math.round(Math.min(format.framerate.max,
- (int) Math.round(bandwidth / (format.width * format.height))) / 1000.0);
+ (int) Math.round(bandwidth / (format.size.width * format.size.height))) / 1000.0);
perkj_webrtc 2016/06/14 13:01:19 nit size.GetArea() = ?
sakal 2016/06/14 13:12:51 Done.
}
}
« no previous file with comments | « webrtc/api/java/jni/androidvideocapturer_jni.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698