From 7b2f7627e4241cf0904f63ee6e94eeff3ba9b2e0 Mon Sep 17 00:00:00 2001 From: perkj Date: Tue, 8 Dec 2015 12:03:00 -0800 Subject: [PATCH] Don't call SetPreviewFormat if capturing to textures. This fix an issue seen on Huawei Y300 where the camera feed is black and white if we capture to textures and setpreviewformat is called. BUG=webrtc:4993 Review URL: https://codereview.webrtc.org/1502223002 Cr-Commit-Position: refs/heads/master@{#10941} --- .../webrtc/java/android/org/webrtc/VideoCapturerAndroid.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java index 7fa32f8050..2bfa9787ed 100644 --- a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java +++ b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java @@ -550,7 +550,10 @@ public class VideoCapturerAndroid extends VideoCapturer implements parameters.setPreviewFpsRange(captureFormat.minFramerate, captureFormat.maxFramerate); } parameters.setPreviewSize(captureFormat.width, captureFormat.height); - parameters.setPreviewFormat(captureFormat.imageFormat); + + if (!isCapturingToTexture) { + parameters.setPreviewFormat(captureFormat.imageFormat); + } // Picture size is for taking pictures and not for preview/video, but we need to set it anyway // as a workaround for an aspect ratio problem on Nexus 7. final android.hardware.Camera.Size pictureSize =