Index: git/sys/v4l2/gstv4l2object.c
===================================================================
--- git.orig/sys/v4l2/gstv4l2object.c
+++ git/sys/v4l2/gstv4l2object.c
@@ -165,6 +165,16 @@ static const GstV4L2FormatDesc gst_v4l2_
   {V4L2_PIX_FMT_SGRBG8, TRUE, GST_V4L2_RAW},
   {V4L2_PIX_FMT_SRGGB8, TRUE, GST_V4L2_RAW},
 
+  {V4L2_PIX_FMT_SBGGR10, TRUE, GST_V4L2_RAW},
+  {V4L2_PIX_FMT_SGBRG10, TRUE, GST_V4L2_RAW},
+  {V4L2_PIX_FMT_SGRBG10, TRUE, GST_V4L2_RAW},
+  {V4L2_PIX_FMT_SRGGB10, TRUE, GST_V4L2_RAW},
+
+  {V4L2_PIX_FMT_SBGGR12, TRUE, GST_V4L2_RAW},
+  {V4L2_PIX_FMT_SGBRG12, TRUE, GST_V4L2_RAW},
+  {V4L2_PIX_FMT_SGRBG12, TRUE, GST_V4L2_RAW},
+  {V4L2_PIX_FMT_SRGGB12, TRUE, GST_V4L2_RAW},
+
   /* compressed formats */
   {V4L2_PIX_FMT_MJPEG, FALSE, GST_V4L2_CODEC},
   {V4L2_PIX_FMT_JPEG, FALSE, GST_V4L2_CODEC},
@@ -1130,6 +1140,14 @@ gst_v4l2_object_format_get_rank (const s
     case V4L2_PIX_FMT_SGBRG8:
     case V4L2_PIX_FMT_SGRBG8:
     case V4L2_PIX_FMT_SRGGB8:
+    case V4L2_PIX_FMT_SBGGR10:
+    case V4L2_PIX_FMT_SGBRG10:
+    case V4L2_PIX_FMT_SGRBG10:
+    case V4L2_PIX_FMT_SRGGB10:
+    case V4L2_PIX_FMT_SBGGR12:
+    case V4L2_PIX_FMT_SGBRG12:
+    case V4L2_PIX_FMT_SGRBG12:
+    case V4L2_PIX_FMT_SRGGB12:
       rank = BAYER_BASE_RANK;
       break;
 
@@ -1423,6 +1441,14 @@ gst_v4l2_object_v4l2fourcc_is_rgb (guint
     case V4L2_PIX_FMT_SGBRG8:
     case V4L2_PIX_FMT_SGRBG8:
     case V4L2_PIX_FMT_SRGGB8:
+    case V4L2_PIX_FMT_SBGGR10:
+    case V4L2_PIX_FMT_SGBRG10:
+    case V4L2_PIX_FMT_SGRBG10:
+    case V4L2_PIX_FMT_SRGGB10:
+    case V4L2_PIX_FMT_SBGGR12:
+    case V4L2_PIX_FMT_SGBRG12:
+    case V4L2_PIX_FMT_SGRBG12:
+    case V4L2_PIX_FMT_SRGGB12:
     case V4L2_PIX_FMT_RGBA:
       ret = TRUE;
       break;
@@ -1574,11 +1600,43 @@ gst_v4l2_object_v4l2fourcc_to_bare_struc
     case V4L2_PIX_FMT_SGBRG8:
     case V4L2_PIX_FMT_SGRBG8:
     case V4L2_PIX_FMT_SRGGB8:
+    case V4L2_PIX_FMT_SBGGR10:
+    case V4L2_PIX_FMT_SGBRG10:
+    case V4L2_PIX_FMT_SGRBG10:
+    case V4L2_PIX_FMT_SRGGB10:
+    case V4L2_PIX_FMT_SBGGR12:
+    case V4L2_PIX_FMT_SGBRG12:
+    case V4L2_PIX_FMT_SGRBG12:
+    case V4L2_PIX_FMT_SRGGB12:
       structure = gst_structure_new ("video/x-bayer", "format", G_TYPE_STRING,
-          fourcc == V4L2_PIX_FMT_SBGGR8 ? "bggr" :
-          fourcc == V4L2_PIX_FMT_SGBRG8 ? "gbrg" :
-          fourcc == V4L2_PIX_FMT_SGRBG8 ? "grbg" :
-          /* fourcc == V4L2_PIX_FMT_SRGGB8 ? */ "rggb", NULL);
+         (fourcc == V4L2_PIX_FMT_SBGGR8  ? "bggr" :
+          fourcc == V4L2_PIX_FMT_SBGGR10 ? "bggr" :
+          fourcc == V4L2_PIX_FMT_SBGGR12 ? "bggr" :
+
+          fourcc == V4L2_PIX_FMT_SGBRG8  ? "gbrg" :
+          fourcc == V4L2_PIX_FMT_SGBRG10 ? "gbrg" :
+          fourcc == V4L2_PIX_FMT_SGBRG12 ? "gbrg" :
+
+          fourcc == V4L2_PIX_FMT_SGRBG8  ? "grbg" :
+          fourcc == V4L2_PIX_FMT_SGRBG10 ? "grbg" :
+          fourcc == V4L2_PIX_FMT_SGRBG12 ? "grbg" :
+
+          "rggb"),
+
+          "bpp", G_TYPE_INT,
+          (fourcc == V4L2_PIX_FMT_SBGGR10  ? 10 :
+           fourcc == V4L2_PIX_FMT_SGBRG10  ? 10 :
+           fourcc == V4L2_PIX_FMT_SGRBG10  ? 10 :
+           fourcc == V4L2_PIX_FMT_SRGGB10  ? 10 :
+
+           fourcc == V4L2_PIX_FMT_SBGGR12  ? 12 :
+           fourcc == V4L2_PIX_FMT_SGBRG12  ? 12 :
+           fourcc == V4L2_PIX_FMT_SGRBG12  ? 12 :
+           fourcc == V4L2_PIX_FMT_SRGGB12  ? 12 :
+
+           8),
+
+          NULL);
       break;
     case V4L2_PIX_FMT_SN9C10X:
       structure = gst_structure_new_empty ("video/x-sonix");
@@ -1924,15 +1982,26 @@ gst_v4l2_object_get_caps_info (GstV4l2Ob
       fourcc = V4L2_PIX_FMT_VP9;
     } else if (g_str_equal (mimetype, "video/x-bayer")) {
       const gchar *format = gst_structure_get_string (structure, "format");
+      gint bpp;
+      if (!gst_structure_get_int(structure, "bpp", &bpp))
+        bpp = 8;
       if (format) {
         if (!g_ascii_strcasecmp (format, "bggr"))
-          fourcc = V4L2_PIX_FMT_SBGGR8;
+          fourcc = (bpp == 10 ? V4L2_PIX_FMT_SBGGR10 :
+                    bpp == 12 ? V4L2_PIX_FMT_SBGGR12 :
+                    V4L2_PIX_FMT_SBGGR8);
         else if (!g_ascii_strcasecmp (format, "gbrg"))
-          fourcc = V4L2_PIX_FMT_SGBRG8;
+          fourcc = (bpp == 10 ? V4L2_PIX_FMT_SGBRG10 :
+                    bpp == 12 ? V4L2_PIX_FMT_SGBRG12 :
+                    V4L2_PIX_FMT_SGBRG8);
         else if (!g_ascii_strcasecmp (format, "grbg"))
-          fourcc = V4L2_PIX_FMT_SGRBG8;
+          fourcc = (bpp == 10 ? V4L2_PIX_FMT_SGRBG10 :
+                    bpp == 12 ? V4L2_PIX_FMT_SGRBG12 :
+                    V4L2_PIX_FMT_SGRBG8);
         else if (!g_ascii_strcasecmp (format, "rggb"))
-          fourcc = V4L2_PIX_FMT_SRGGB8;
+          fourcc = (bpp == 10 ? V4L2_PIX_FMT_SRGGB10 :
+                    bpp == 12 ? V4L2_PIX_FMT_SRGGB12 :
+                    V4L2_PIX_FMT_SRGGB8);
       }
     } else if (g_str_equal (mimetype, "video/x-sonix")) {
       fourcc = V4L2_PIX_FMT_SN9C10X;
