Skip to content

Commit

Permalink
Add NV12 to supported pixel formats in NativeMethods_V4L2.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Muny committed Apr 12, 2025
1 parent 51ac1e4 commit f5e95d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions FlashCap.Core/Internal/NativeMethods_V4L2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f5e95d4

Please sign in to comment.