sailfishos / droidmedia

15 stars 58 forks source link

Camera2: more locale issues #119

Open simonschmeisser opened 10 months ago

simonschmeisser commented 10 months ago

Using std::stof will truncate floats if the decimal separator of the current locale is not .

https://github.com/sailfishos/droidmedia/blob/f8426e752717ce4497fdb515e32f1c7e4d5dbbd2/droidmediacamera2.cpp#L1596

std::to_string will print a localized decimal separator , in my case https://github.com/sailfishos/droidmedia/blob/camera2-test3/droidmediacamera2.cpp#L1881

I'm a bit confused why I'm not seeing this in logs:

DroidMediaCamera: get_parameters result: video-size=-1x-1;video-frame-format=android-opaque;antibanding-values=off,50hz,60hz,auto;preview-fps-range-values=(15000,30000);preview-frame-rate=30;min-exposure-compensation=-12;max-exposure-compensation=12;exposure-compensation-step=0.166667;focus-mode-values=infinity,auto,macro,continuous-video,continuous-picture;effect-values=none,mono,negative,solarize,sepia,posterize,aqua,blackboard,whiteboard;scene-mode-values=auto,auto,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,fireworks,sports,party,candlelight,hdr;whitebalance-values=auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight,twilight,shade,;max-num-focus-areas=0;max-num-metering-areas=1;auto-exposure-lock-supported=true;auto-exposure-lock=false;auto-whitebalance-lock-supported=true;auto-whitebalance-lock=false;flash-mode-values=off,auto,on,torch;picture-size-values=4000x3000,3840x2160,3264x2448,3200x2400,2976x2976,2688x1512,2592x1944,2048x1536,1920x1440,1920x1080,1600x1200,1440x1080

because I assume I'm compiling for android 11: ANDROID_VERSION_MAJOR="11"

mlehtima commented 10 months ago

I think in some cases the log messages get truncated so some parts could be missing.