v4l2: Enable VP9 format

This was missing, preventing the encoder and decoder to work
properly. This also adds support for camera that would produce
VP9 (if that exists).
This commit is contained in:
Nicolas Dufresne 2017-08-02 17:13:55 -04:00
parent a13c24dc8c
commit 0e9fe263ca
2 changed files with 8 additions and 0 deletions

View 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) {

View 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")) {