From e94e92330c4178bef7e8f8c934b747be124b262b Mon Sep 17 00:00:00 2001 From: smcveigh Date: Fri, 29 Aug 2014 00:20:36 -0400 Subject: [PATCH] update viewfinder-start code to kick the aspect-ratio constraint function, since it is not guaranteed that the viewfinder aspect ratios will match between mode changes. --- BestCamera/src/BestCam.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BestCamera/src/BestCam.cpp b/BestCamera/src/BestCam.cpp index 6ca198f..6dc18b5 100644 --- a/BestCamera/src/BestCam.cpp +++ b/BestCamera/src/BestCam.cpp @@ -410,6 +410,10 @@ int BestCam::startPhotoVf() // to make sure to decrement using _deregister_ when we are finished with resources. when the count of // registrations reaches 0, the OS will allow the camera to be powered off (or after a couple of seconds of grace). err = camera_register_resource(mHandle); + + // since aspect ratio is only updated on a display size change, and we may be changing viewfinder + // resolutions in a photo<->video switch, we need to kick the code to adjust the size onscreen + constrainViewfinderAspectRatio(); } } } @@ -469,6 +473,10 @@ int BestCam::startVideoVf() camera_get_videovf_property(mHandle, CAMERA_IMGPROP_WIDTH, &mVfWidth, CAMERA_IMGPROP_HEIGHT, &mVfHeight); + + // since aspect ratio is only updated on a display size change, and we may be changing viewfinder + // resolutions in a photo<->video switch, we need to kick the code to adjust the size onscreen + constrainViewfinderAspectRatio(); } }