Improve links to use sinks

This commit is contained in:
Kamil Trzcinski
2022-04-06 08:51:28 +02:00
parent 4d999d9426
commit e52a2326c3
6 changed files with 43 additions and 35 deletions

View File

@ -44,16 +44,16 @@ int camera_configure_decoder(camera_t *camera)
link_t *links = camera->links;
if (camera->options.format == V4L2_PIX_FMT_MJPEG || camera->options.format == V4L2_PIX_FMT_JPEG) {
*links++ = (link_t){ camera->camera, { camera->decoder }, { http_jpeg_capture, http_jpeg_needs_buffer } };
*links++ = (link_t){ camera->decoder, { camera->codec_h264 } };
*links++ = (link_t){ camera->camera, { camera->decoder->output_list }, { http_jpeg_capture, http_jpeg_needs_buffer } };
*links++ = (link_t){ camera->decoder, { camera->codec_h264->output_list } };
*links++ = (link_t){ camera->codec_h264, { }, { http_h264_capture, http_h264_needs_buffer } };
} else if (camera->options.format != V4L2_PIX_FMT_H264) {
*links++ = (link_t){ camera->camera, { camera->decoder }, { http_h264_capture, http_h264_needs_buffer }};
*links++ = (link_t){ camera->decoder, { camera->codec_jpeg } };
*links++ = (link_t){ camera->camera, { camera->decoder->output_list }, { http_h264_capture, http_h264_needs_buffer }};
*links++ = (link_t){ camera->decoder, { camera->codec_jpeg->output_list } };
*links++ = (link_t){ camera->codec_jpeg, { }, { http_jpeg_capture, http_jpeg_needs_buffer } };
} else {
*links++ = (link_t){ camera->camera, { camera->decoder } };
*links++ = (link_t){ camera->decoder, { camera->codec_jpeg, camera->codec_h264 } };
*links++ = (link_t){ camera->camera, { camera->decoder->output_list } };
*links++ = (link_t){ camera->decoder, { camera->codec_jpeg->output_list, camera->codec_h264->output_list } };
*links++ = (link_t){ camera->codec_jpeg, { }, { http_jpeg_capture, http_jpeg_needs_buffer } };
*links++ = (link_t){ camera->codec_h264, { }, { http_h264_capture, http_h264_needs_buffer } };
}

View File

@ -27,7 +27,7 @@ int camera_configure_direct(camera_t *camera)
link_t *links = camera->links;
*links++ = (link_t){ camera->camera, { camera->codec_jpeg, camera->codec_h264 } };
*links++ = (link_t){ camera->camera, { camera->codec_jpeg->output_list, camera->codec_h264->output_list } };
*links++ = (link_t){ camera->codec_jpeg, { }, { http_jpeg_capture, http_jpeg_needs_buffer } };
*links++ = (link_t){ camera->codec_h264, { }, { http_h264_capture, http_h264_needs_buffer } };
return 0;

View File

@ -54,13 +54,13 @@ int camera_configure_isp(camera_t *camera, float high_div, float low_div)
link_t *links = camera->links;
*links++ = (link_t){ camera->camera, { camera->isp_srgb } };
*links++ = (link_t){ camera->camera, { camera->isp_srgb->output_list } };
if (camera->isp_yuuv_low) {
*links++ = (link_t){ camera->isp_yuuv, { } };
*links++ = (link_t){ camera->isp_yuuv_low, { camera->codec_jpeg, camera->codec_h264 }, { write_yuvu } };
*links++ = (link_t){ camera->isp_yuuv_low, { camera->codec_jpeg->output_list, camera->codec_h264->output_list }, { write_yuvu } };
} else {
*links++ = (link_t){ camera->isp_yuuv, { camera->codec_jpeg, camera->codec_h264 }, { write_yuvu } };
*links++ = (link_t){ camera->isp_yuuv, { camera->codec_jpeg->output_list, camera->codec_h264->output_list }, { write_yuvu } };
}
*links++ = (link_t){ camera->codec_jpeg, { }, { http_jpeg_capture, http_jpeg_needs_buffer } };

View File

@ -47,8 +47,8 @@ int camera_configure_legacy_isp(camera_t *camera, float div)
link_t *links = camera->links;
*links++ = (link_t){ camera->camera, { camera->legacy_isp } };
*links++ = (link_t){ camera->legacy_isp, { camera->codec_jpeg, camera->codec_h264 }, { write_yuvu, NULL } };
*links++ = (link_t){ camera->camera, { camera->legacy_isp->output_list } };
*links++ = (link_t){ camera->legacy_isp, { camera->codec_jpeg->output_list, camera->codec_h264->output_list }, { write_yuvu, NULL } };
*links++ = (link_t){ camera->codec_jpeg, { }, { http_jpeg_capture, http_jpeg_needs_buffer } };
*links++ = (link_t){ camera->codec_h264, { }, { http_h264_capture, http_h264_needs_buffer } };
return 0;