Make it work

This commit is contained in:
Kamil Trzcinski 2022-04-05 09:22:07 +02:00
parent 94df5c155c
commit 3159cd5688
3 changed files with 14 additions and 3 deletions

View File

@ -7,8 +7,8 @@
void camera_init(camera_t *camera)
{
memset(camera, 0, sizeof(*camera));
camera->width = 2328;
camera->height = 1748;
camera->width = 1280;
camera->height = 720;
camera->nbufs = 4;
}

View File

@ -22,7 +22,8 @@ int camera_configure_srgb_legacy_isp(camera_t *camera)
camera->codec_jpeg = device_open("JPEG", "/dev/video31");
camera->codec_h264 = device_open("H264", "/dev/video11");
if (device_open_buffer_list(camera->legacy_isp.isp, false, src->fmt_width, src->fmt_height, src->fmt_format, camera->nbufs) < 0) {
if (device_open_buffer_list(camera->legacy_isp.isp, false, src->fmt_width, src->fmt_height, src->fmt_format, camera->nbufs) < 0 ||
device_open_buffer_list(camera->legacy_isp.isp, true, src->fmt_width, src->fmt_height, V4L2_PIX_FMT_YUYV, camera->nbufs) < 0) {
return -1;
}

View File

@ -33,13 +33,23 @@ int main(int argc, char *argv[])
camera_init(&camera);
// camera.width = 2328;
// camera.height = 1748;
// camera.nbufs = 4;
if (camera_open(&camera, "/dev/video0") < 0) {
goto error;
}
#if 0
if (camera_configure_srgb_isp(&camera, true) < 0) {
goto error;
}
#else
if (camera_configure_srgb_legacy_isp(&camera) < 0) {
goto error;
}
#endif
if (camera_set_params(&camera) < 0) {
goto error;