Add BGR32 to V42L Grabber

This commit is contained in:
Lord-Grey 2024-06-01 08:16:06 +02:00
parent 1439076134
commit daec1624b5

View File

@ -559,6 +559,10 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB32; fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB32;
break; break;
case PixelFormat::BGR32:
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_BGR32;
break;
case PixelFormat::RGB24: case PixelFormat::RGB24:
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
break; break;
@ -697,6 +701,14 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
} }
break; break;
case V4L2_PIX_FMT_BGR32:
{
_pixelFormat = PixelFormat::BGR32;
_frameByteSize = _width * _height * 4;
Debug(_log, "Pixel format=BGR32");
}
break;
case V4L2_PIX_FMT_RGB24: case V4L2_PIX_FMT_RGB24:
{ {
_pixelFormat = PixelFormat::RGB24; _pixelFormat = PixelFormat::RGB24;
@ -756,9 +768,9 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
default: default:
#ifdef HAVE_TURBO_JPEG #ifdef HAVE_TURBO_JPEG
throw_exception("Only pixel formats RGB32, RGB24, BGR24, YUYV, UYVY, NV12, I420 and MJPEG are supported"); throw_exception("Only pixel formats RGB32, BGR32, RGB24, BGR24, YUYV, UYVY, NV12, I420 and MJPEG are supported");
#else #else
throw_exception("Only pixel formats RGB32, RGB24, BGR24, YUYV, UYVY, NV12 and I420 are supported"); throw_exception("Only pixel formats RGB32, BGR32, RGB24, BGR24, YUYV, UYVY, NV12 and I420 are supported");
#endif #endif
return; return;
} }