Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
update viewfinder-start code to kick the aspect-ratio constraint func…
Browse files Browse the repository at this point in the history
…tion, since it is not guaranteed that the viewfinder aspect ratios will match between mode changes.
  • Loading branch information
smcveigh committed Aug 29, 2014
1 parent 40a1ad2 commit e94e923
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions BestCamera/src/BestCam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down Expand Up @@ -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();
}
}

Expand Down

0 comments on commit e94e923

Please sign in to comment.