Add -snapshot.height
, -stream.height
and -video.height
This commit is contained in:

committed by
Kamil Trzcinski

parent
c18561c9f8
commit
ca08adb62f
@ -10,67 +10,16 @@
|
||||
#include "device/buffer_list.h"
|
||||
#include "util/http/http.h"
|
||||
|
||||
int camera_configure_output_rescaler2(camera_t *camera, buffer_list_t *src_capture, float div, int res);
|
||||
|
||||
int camera_configure_isp(camera_t *camera, buffer_list_t *src_capture, float high_div, float low_div)
|
||||
buffer_list_t *camera_configure_isp(camera_t *camera, buffer_list_t *src_capture)
|
||||
{
|
||||
camera->isp = device_v4l2_open("ISP", "/dev/video13");
|
||||
|
||||
buffer_list_t *isp_output = device_open_buffer_list_output(
|
||||
camera->isp, src_capture);
|
||||
buffer_list_t *isp_capture = device_open_buffer_list_capture2(
|
||||
camera->isp, "/dev/video14", isp_output, high_div, V4L2_PIX_FMT_YUYV, true);
|
||||
|
||||
camera_capture_add_output(camera, src_capture, isp_output);
|
||||
|
||||
if (camera_configure_output(camera, isp_capture, 0) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if 1
|
||||
return camera_configure_output_rescaler2(camera, isp_capture, low_div, 1);
|
||||
#else
|
||||
if (low_div > 1) {
|
||||
// TODO: Currently we cannot pull the data at the same time from /dev/video14 and /dev/video15
|
||||
// if only one path (consuming /dev/video15) is activated
|
||||
buffer_list_t *isp_lowres_capture = device_open_buffer_list_capture2(
|
||||
camera->isp, "/dev/video15", isp_output, low_div, V4L2_PIX_FMT_YUYV, true);
|
||||
|
||||
if (camera_configure_output(camera, isp_lowres_capture, 1) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const char *isp_names[2] = {
|
||||
"ISP",
|
||||
"ISP-LOW"
|
||||
};
|
||||
|
||||
int camera_configure_legacy_isp(camera_t *camera, buffer_list_t *src_capture, float div, int res)
|
||||
{
|
||||
device_info_t *device = device_list_find_m2m_format(camera->device_list, src_capture->fmt.format, V4L2_PIX_FMT_YUYV);
|
||||
|
||||
if (!device) {
|
||||
LOG_INFO(camera, "Cannot find ISP to scale from '%s' to 'YUYV'", fourcc_to_string(src_capture->fmt.format).buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
camera->legacy_isp[res] = device_v4l2_open(isp_names[res], device->path);
|
||||
|
||||
buffer_list_t *isp_output = device_open_buffer_list_output(
|
||||
camera->legacy_isp[res], src_capture);
|
||||
buffer_list_t *isp_capture = device_open_buffer_list_capture(
|
||||
camera->legacy_isp[res], isp_output, div, V4L2_PIX_FMT_YUYV, true);
|
||||
camera->isp, "/dev/video14", isp_output, 0, 0, V4L2_PIX_FMT_YUYV, true);
|
||||
|
||||
camera_capture_add_output(camera, src_capture, isp_output);
|
||||
|
||||
if (camera_configure_output(camera, isp_capture, res) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return isp_capture;
|
||||
}
|
||||
|
Reference in New Issue
Block a user