v4l2: Enable VP9 format
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 2 Aug 2017 21:13:55 +0000 (17:13 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 2 Aug 2017 21:13:55 +0000 (17:13 -0400)
This was missing, preventing the encoder and decoder to work
properly. This also adds support for camera that would produce
VP9 (if that exists).

sys/v4l2/gstv4l2object.c
sys/v4l2/gstv4l2videodec.c

index f902a82..af62d6d 100644 (file)
@@ -181,6 +181,7 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = {
   {V4L2_PIX_FMT_VC1_ANNEX_G, FALSE, GST_V4L2_CODEC},
   {V4L2_PIX_FMT_VC1_ANNEX_L, FALSE, GST_V4L2_CODEC},
   {V4L2_PIX_FMT_VP8, FALSE, GST_V4L2_CODEC | GST_V4L2_NO_PARSE},
+  {V4L2_PIX_FMT_VP9, FALSE, GST_V4L2_CODEC | GST_V4L2_NO_PARSE},
 
   /*  Vendor-specific formats   */
   {V4L2_PIX_FMT_WNVA, TRUE, GST_V4L2_CODEC},
@@ -1412,6 +1413,9 @@ gst_v4l2_object_v4l2fourcc_to_bare_struct (guint32 fourcc)
     case V4L2_PIX_FMT_VP8:
       structure = gst_structure_new_empty ("video/x-vp8");
       break;
+    case V4L2_PIX_FMT_VP9:
+      structure = gst_structure_new_empty ("video/x-vp9");
+      break;
     case V4L2_PIX_FMT_GREY:    /*  8  Greyscale     */
     case V4L2_PIX_FMT_Y16:
     case V4L2_PIX_FMT_Y16_BE:
@@ -1779,6 +1783,8 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
         fourcc = V4L2_PIX_FMT_H264;
     } else if (g_str_equal (mimetype, "video/x-vp8")) {
       fourcc = V4L2_PIX_FMT_VP8;
+    } else if (g_str_equal (mimetype, "video/x-vp9")) {
+      fourcc = V4L2_PIX_FMT_VP9;
     } else if (g_str_equal (mimetype, "video/x-bayer")) {
       const gchar *format = gst_structure_get_string (structure, "format");
       if (format) {
index 29fbfb9..8e369fa 100644 (file)
@@ -1029,6 +1029,8 @@ G_STMT_START { \
     SET_META ("VC1");
   } else if (gst_structure_has_name (s, "video/x-vp8")) {
     SET_META ("VP8");
+  } else if (gst_structure_has_name (s, "video/x-vp9")) {
+    SET_META ("VP9");
   } else if (gst_structure_has_name (s, "video/x-bayer")) {
     SET_META ("BAYER");
   } else if (gst_structure_has_name (s, "video/x-sonix")) {