mfvideosrc: add GRAY16_LE format support
authorJoshua M. Doe <oss@nvl.army.mil>
Tue, 28 Apr 2020 18:55:00 +0000 (14:55 -0400)
committerJoshua M. Doe <oss@nvl.army.mil>
Tue, 28 Apr 2020 19:14:50 +0000 (15:14 -0400)
FOURCC "Y16 " is used by FLIR Boson USB Video Class (UVC) camera

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1222>

sys/mediafoundation/gstmfutils.cpp
sys/mediafoundation/gstmfutils.h

index a0fe636..22bcbb8 100644 (file)
@@ -35,6 +35,9 @@ GST_DEBUG_CATEGORY_EXTERN (gst_mf_utils_debug);
 #define MAKE_RAW_FORMAT_CAPS(format) \
     "video/x-raw, format = (string) " format
 
+/* No GUID is defined for "Y16 " in mfapi.h, but it's used by several devices */
+DEFINE_MEDIATYPE_GUID (MFVideoFormat_Y16, FCC ('Y16 '));
+
 static struct
 {
   const GUID &mf_format;
@@ -58,6 +61,7 @@ static struct
   {MFVideoFormat_P016,   MAKE_RAW_FORMAT_CAPS ("P016"),  GST_VIDEO_FORMAT_P016_LE},
   {MFVideoFormat_v210,   MAKE_RAW_FORMAT_CAPS ("v210"),  GST_VIDEO_FORMAT_v210},
   {MFVideoFormat_v216,   MAKE_RAW_FORMAT_CAPS ("v216"),  GST_VIDEO_FORMAT_v216},
+  {MFVideoFormat_Y16,    MAKE_RAW_FORMAT_CAPS ("GRAY16_LE"),  GST_VIDEO_FORMAT_GRAY16_LE},
 };
 
 static struct
index 80624a4..cdb2cd9 100644 (file)
@@ -40,7 +40,7 @@ G_BEGIN_DECLS
 
 #define GST_MF_VIDEO_FORMATS \
   "{ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420," \
-  " P010, P016, v210, v216 }"
+  " P010, P016, v210, v216, GRAY16_LE }"
 
 GstVideoFormat gst_mf_video_subtype_to_video_format (const GUID *subtype);