Add Support for YUV420 and YVU variants. (#276)

* Add Support fo YUV420 and 410 and YVU variants.

* Add new formats to the help messaging

* Remove YUV410 supprt since M2M encoder on Pi cannot convert it

* Cleanups requested by @mdevaev

* Change to use u8 per @mdevaev
This commit is contained in:
Sam Listopad
2025-01-26 22:14:18 -06:00
committed by GitHub
parent b304364af9
commit db297db52e
4 changed files with 81 additions and 17 deletions

View File

@@ -82,6 +82,8 @@ bool us_frame_compare(const us_frame_s *a, const us_frame_s *b) {
uint us_frame_get_padding(const us_frame_s *frame) {
uint bytes_per_pixel = 0;
switch (frame->format) {
case V4L2_PIX_FMT_YVU420:
case V4L2_PIX_FMT_YUV420: bytes_per_pixel = 1; break;
case V4L2_PIX_FMT_YUYV:
case V4L2_PIX_FMT_YVYU:
case V4L2_PIX_FMT_UYVY: