From f5e95d4c984de5a35e5089f490d14bf992ec831e Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 5 Feb 2024 22:26:15 -0500 Subject: [PATCH] Add NV12 to supported pixel formats in NativeMethods_V4L2.cs --- FlashCap.Core/Internal/NativeMethods_V4L2.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FlashCap.Core/Internal/NativeMethods_V4L2.cs b/FlashCap.Core/Internal/NativeMethods_V4L2.cs index 7722ce9..cf40402 100644 --- a/FlashCap.Core/Internal/NativeMethods_V4L2.cs +++ b/FlashCap.Core/Internal/NativeMethods_V4L2.cs @@ -91,6 +91,7 @@ static NativeMethods_V4L2() pixelFormats.Add(Interop.V4L2_PIX_FMT_UYVY, PixelFormats.UYVY); pixelFormats.Add(Interop.V4L2_PIX_FMT_YUYV, PixelFormats.YUYV); pixelFormats.Add(Interop.V4L2_PIX_FMT_YUY2, PixelFormats.YUYV); + pixelFormats.Add(Interop.V4L2_PIX_FMT_NV12, PixelFormats.NV12); } public static bool IsKnownPixelFormat(uint pix_fmt) => @@ -324,6 +325,8 @@ public static uint[] GetPixelFormats( return new[] { Interop.V4L2_PIX_FMT_UYVY }; case PixelFormats.YUYV: return new[] { Interop.V4L2_PIX_FMT_YUYV, Interop.V4L2_PIX_FMT_YUY2 }; + case PixelFormats.NV12: + return new[] { Interop.V4L2_PIX_FMT_NV12 }; case PixelFormats.JPEG: return new[] { Interop.V4L2_PIX_FMT_MJPEG, Interop.V4L2_PIX_FMT_JPEG, (uint)NativeMethods.Compression.BI_JPEG }; case PixelFormats.PNG: