OSDN Git Service

Fix check of getSupportedVideoSizes()
authorJustin Chuang <jchuang@google.com>
Wed, 6 Apr 2016 10:25:01 +0000 (18:25 +0800)
committerSheng-hao Tsao <shenghao@google.com>
Mon, 14 Aug 2017 09:22:22 +0000 (09:22 +0000)
com.android.ex.camera2.portability.CameraCapabilities.getSupportedVideoSizes()
does not return null even when
android.hardware.Camera.Parameters.getSupportedVideoSizes() returns
NULL.

BUG=27805501

Change-Id: Ie1bbf9ffcfc1a947ebfdd9f9fb7a2ab87ea6b7ef
(cherry picked from commit bcfede4820c2c5177ec2ff1b63495f6569050b16)

src/com/android/camera/VideoModule.java

index 9a941c7..e8222f6 100644 (file)
@@ -808,7 +808,8 @@ public class VideoModule extends CameraModule
      */
     private static Point getDesiredPreviewSize(CameraCapabilities capabilities,
           CamcorderProfile profile, Point previewScreenSize) {
-        if (capabilities.getSupportedVideoSizes() == null) {
+        if (capabilities.getSupportedVideoSizes() == null ||
+            capabilities.getSupportedVideoSizes().isEmpty()) {
             // Driver doesn't support separate outputs for preview and video.
             return new Point(profile.videoFrameWidth, profile.videoFrameHeight);
         }