Index: webrtc/api/android/java/src/org/webrtc/VideoSource.java |
diff --git a/webrtc/api/android/java/src/org/webrtc/VideoSource.java b/webrtc/api/android/java/src/org/webrtc/VideoSource.java |
index f664f19d2c6842ffc313c729dab05b6d4dc8eda0..239940d765cc14b08d4e0a41c03bf7b8bd434315 100644 |
--- a/webrtc/api/android/java/src/org/webrtc/VideoSource.java |
+++ b/webrtc/api/android/java/src/org/webrtc/VideoSource.java |
@@ -12,14 +12,23 @@ |
package org.webrtc; |
/** |
- * Java version of VideoSourceInterface, extended with stop/restart |
- * functionality to allow explicit control of the camera device on android, |
- * where there is no support for multiple open capture devices and the cost of |
- * holding a camera open (even if MediaStreamTrack.setEnabled(false) is muting |
- * its output to the encoder) can be too high to bear. |
+ * Java wrapper of native AndroidVideoTrackSource. |
*/ |
public class VideoSource extends MediaSource { |
public VideoSource(long nativeSource) { |
super(nativeSource); |
} |
+ |
+ /** |
+ * Calling this function will cause frames to be scaled down to the requested resolution. Also, |
+ * frames will be cropped to match the requested aspect ratio, and frames will be dropped to match |
+ * the requested fps. The requested aspect ratio is orientation agnostic and will be adjusted to |
+ * maintain the input orientation, so it doesn't matter if e.g. 1280x720 or 720x1280 is requested. |
+ */ |
+ public void adaptOutputFormat(int width, int height, int fps) { |
+ nativeAdaptOutputFormat(nativeSource, width, height, fps); |
+ } |
+ |
+ private static native void nativeAdaptOutputFormat( |
+ long nativeSource, int width, int height, int fps); |
} |