Fix format parsing
This commit is contained in:
@@ -241,13 +241,13 @@ load_camera(libmegapixels_devconfig *config, config_t *cfg, const char *name)
|
|||||||
|
|
||||||
const char *fmt;
|
const char *fmt;
|
||||||
config_setting_lookup_string(mode, "Format", &fmt);
|
config_setting_lookup_string(mode, "Format", &fmt);
|
||||||
int format = libmegapixels_format_name_to_index(fmt);
|
mm->format = libmegapixels_format_name_to_index(fmt);
|
||||||
if (!format) {
|
if (!mm->format) {
|
||||||
log_error("Unknown format '%s'\n", fmt);
|
log_error("Unknown format '%s'\n", fmt);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
mm->v4l_pixfmt = libmegapixels_format_to_v4l_pixfmt(format);
|
mm->v4l_pixfmt = libmegapixels_format_to_v4l_pixfmt(mm->format);
|
||||||
mm->media_busfmt = libmegapixels_format_to_media_busfmt(format);
|
mm->media_busfmt = libmegapixels_format_to_media_busfmt(mm->format);
|
||||||
|
|
||||||
if (!config_setting_lookup_int(mode, "Rotate", &mm->rotation)) {
|
if (!config_setting_lookup_int(mode, "Rotate", &mm->rotation)) {
|
||||||
mm->rotation = 0;
|
mm->rotation = 0;
|
||||||
|
Reference in New Issue
Block a user