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

Unified Diff: webrtc/api/android/java/src/org/webrtc/VideoSource.java

Issue 2350933006: Android VideoSource: Add adaptOutputFormat function (Closed)
Patch Set: Remove thread check in OnOutputFormatRequest Created 4 years, 3 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
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);
}
« no previous file with comments | « webrtc/api/android/java/src/org/webrtc/VideoCapturer.java ('k') | webrtc/api/android/jni/androidvideotracksource_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698