Allow to set -camera-vflip and -camera-hflip

This commit is contained in:
Kamil Trzcinski
2022-08-24 17:48:55 +02:00
parent 8b1d066dfc
commit a9c65fae0d
9 changed files with 61 additions and 3 deletions

View File

@ -226,6 +226,20 @@ int device_set_fps(device_t *dev, int desired_fps)
return 0;
}
int device_set_rotation(device_t *dev, bool vflip, bool hflip)
{
if (!dev)
return -1;
if (dev->hw->device_set_rotation) {
return dev->hw->device_set_rotation(dev, vflip, hflip);
}
int hret = device_set_option_string(dev, "horizontal_flip", hflip ? "1" : "0");
int vret = device_set_option_string(dev, "vertical_flip", vflip ? "1" : "0");
return hret ? hret : vret;
}
int device_set_option_string(device_t *dev, const char *key, const char *value)
{
if (!dev) {