mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-07-23 04:02:12 +00:00
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:
@@ -72,6 +72,8 @@ static const struct {
|
||||
{"BGR24", V4L2_PIX_FMT_BGR24},
|
||||
{"MJPEG", V4L2_PIX_FMT_MJPEG},
|
||||
{"JPEG", V4L2_PIX_FMT_JPEG},
|
||||
{"YU12", V4L2_PIX_FMT_YUV420},
|
||||
{"YV12", V4L2_PIX_FMT_YVU420},
|
||||
};
|
||||
|
||||
static const struct {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#define US_VIDEO_MAX_FPS ((uint)120)
|
||||
|
||||
#define US_STANDARDS_STR "PAL, NTSC, SECAM"
|
||||
#define US_FORMATS_STR "YUYV, YVYU, UYVY, RGB565, RGB24, BGR24, MJPEG, JPEG"
|
||||
#define US_FORMATS_STR "YUYV, YVYU, UYVY, YU12, YV12, RGB565, RGB24, BGR24, MJPEG, JPEG"
|
||||
#define US_IO_METHODS_STR "MMAP, USERPTR"
|
||||
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user