Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpret CONTROL_ZOOM_RATIO locale independent #123

Open
wants to merge 1 commit into
base: camera2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions droidmediacamera2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1515,11 +1515,17 @@ void update_request(DroidMediaCamera *camera, ACaptureRequest *request, std::uno
ACaptureRequest_setEntry_u8(request, key, 1, &value);
break;
}
case ACAMERA_CONTROL_ZOOM_RATIO:
if (float value = std::stof(value_s)) {
case ACAMERA_CONTROL_ZOOM_RATIO: {
// convert from string using no locale
std::istringstream iss(value_s);
iss.imbue(std::locale::classic());
float value = 0;
iss >> value;
if (value != 0) {
ACaptureRequest_setEntry_float(request, key, 1, &value);
}
break;
}
case ACAMERA_FLASH_MODE: {
uint8_t mode;
if (!strcmp(value_s.c_str(), android::CameraParameters::FLASH_MODE_TORCH)) {
Expand Down