Support all rescaling aspects

This commit is contained in:
Kamil Trzcinski
2022-04-12 00:54:38 +02:00
parent 5160bdeb3d
commit d688f7127f
10 changed files with 183 additions and 220 deletions

View File

@ -76,3 +76,28 @@ int camera_configure_output(camera_t *camera, buffer_list_t *src_capture, int re
return camera_configure_h264_output(camera, src_capture, res) == 0 &&
camera_configure_jpeg_output(camera, src_capture, res) == 0;
}
int camera_configure_output_rescaler(camera_t *camera, buffer_list_t *src_capture, float high_div, float low_div)
{
if (high_div > 1) {
if (camera_configure_legacy_isp(camera, src_capture, high_div, 0) < 0) {
return -1;
}
} else if (high_div > 0) {
if (camera_configure_output(camera, src_capture, 0) < 0) {
return -1;
}
}
if (low_div > 1) {
if (camera_configure_legacy_isp(camera, src_capture, low_div, 1) < 0) {
return -1;
}
} else if (low_div > 0) {
if (camera_configure_output(camera, src_capture, 1) < 0) {
return -1;
}
}
return 0;
}