New java ScalingSettings constructors.
Deprecate old constructors. Intended to make java api consistent with
the changes in https://webrtc-review.googlesource.com/c/src/+/46622.
Bug: webrtc:8830
Change-Id: Iadecb5d033b5de841873905af659d8d234b75c7d
Reviewed-on: https://webrtc-review.googlesource.com/49062
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21956}
diff --git a/sdk/android/api/org/webrtc/VideoEncoder.java b/sdk/android/api/org/webrtc/VideoEncoder.java
index 01c249f..f4836c9 100644
--- a/sdk/android/api/org/webrtc/VideoEncoder.java
+++ b/sdk/android/api/org/webrtc/VideoEncoder.java
@@ -97,10 +97,37 @@
public final Integer high;
/**
+ * Settings to disable quality based scaling.
+ */
+ public static final ScalingSettings OFF = new ScalingSettings();
+
+ /**
+ * Creates settings to enable quality based scaling.
+ *
+ * @param low Average QP at which to scale up the resolution.
+ * @param high Average QP at which to scale down the resolution.
+ */
+ public ScalingSettings(int low, int high) {
+ this.on = true;
+ this.low = low;
+ this.high = high;
+ }
+
+ private ScalingSettings() {
+ this.on = false;
+ this.low = null;
+ this.high = null;
+ }
+
+ // TODO(bugs.webrtc.org/8830): Below constructors are deprecated.
+ // Default thresholds are going away, so thresholds have to be set
+ // when scaling is on.
+ /**
* Creates quality based scaling setting.
*
* @param on True if quality scaling is turned on.
*/
+ @Deprecated
public ScalingSettings(boolean on) {
this.on = on;
this.low = null;
@@ -114,6 +141,7 @@
* @param low Average QP at which to scale up the resolution.
* @param high Average QP at which to scale down the resolution.
*/
+ @Deprecated
public ScalingSettings(boolean on, int low, int high) {
this.on = on;
this.low = low;