v4l2videodec: Add HEVC decoder support

https://bugzilla.gnome.org/show_bug.cgi?id=771686
This commit is contained in:
Song Bing 2018-09-13 03:16:32 +00:00 committed by Nicolas Dufresne
parent 2510b5937d
commit 1dc6881a13
2 changed files with 10 additions and 0 deletions

View file

@ -173,6 +173,7 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = {
{V4L2_PIX_FMT_H264, FALSE, GST_V4L2_CODEC}, {V4L2_PIX_FMT_H264, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H264_NO_SC, FALSE, GST_V4L2_CODEC}, {V4L2_PIX_FMT_H264_NO_SC, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H264_MVC, FALSE, GST_V4L2_CODEC}, {V4L2_PIX_FMT_H264_MVC, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_HEVC, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H263, FALSE, GST_V4L2_CODEC}, {V4L2_PIX_FMT_H263, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG1, FALSE, GST_V4L2_CODEC}, {V4L2_PIX_FMT_MPEG1, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG2, FALSE, GST_V4L2_CODEC}, {V4L2_PIX_FMT_MPEG2, FALSE, GST_V4L2_CODEC},
@ -1438,6 +1439,11 @@ gst_v4l2_object_v4l2fourcc_to_bare_struct (guint32 fourcc)
"stream-format", G_TYPE_STRING, "avc", "alignment", "stream-format", G_TYPE_STRING, "avc", "alignment",
G_TYPE_STRING, "au", NULL); G_TYPE_STRING, "au", NULL);
break; break;
case V4L2_PIX_FMT_HEVC: /* H.265 */
structure = gst_structure_new ("video/x-h265",
"stream-format", G_TYPE_STRING, "byte-stream", "alignment",
G_TYPE_STRING, "au", NULL);
break;
case V4L2_PIX_FMT_VC1_ANNEX_G: case V4L2_PIX_FMT_VC1_ANNEX_G:
case V4L2_PIX_FMT_VC1_ANNEX_L: case V4L2_PIX_FMT_VC1_ANNEX_L:
structure = gst_structure_new ("video/x-wmv", structure = gst_structure_new ("video/x-wmv",
@ -1816,6 +1822,8 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
fourcc = V4L2_PIX_FMT_H264_NO_SC; fourcc = V4L2_PIX_FMT_H264_NO_SC;
else else
fourcc = V4L2_PIX_FMT_H264; fourcc = V4L2_PIX_FMT_H264;
} else if (g_str_equal (mimetype, "video/x-h265")) {
fourcc = V4L2_PIX_FMT_HEVC;
} else if (g_str_equal (mimetype, "video/x-vp8")) { } else if (g_str_equal (mimetype, "video/x-vp8")) {
fourcc = V4L2_PIX_FMT_VP8; fourcc = V4L2_PIX_FMT_VP8;
} else if (g_str_equal (mimetype, "video/x-vp9")) { } else if (g_str_equal (mimetype, "video/x-vp9")) {

View file

@ -1085,6 +1085,8 @@ G_STMT_START { \
SET_META ("FWHT"); SET_META ("FWHT");
} else if (gst_structure_has_name (s, "video/x-h264")) { } else if (gst_structure_has_name (s, "video/x-h264")) {
SET_META ("H264"); SET_META ("H264");
} else if (gst_structure_has_name (s, "video/x-h265")) {
SET_META ("H265");
} else if (gst_structure_has_name (s, "video/x-wmv")) { } else if (gst_structure_has_name (s, "video/x-wmv")) {
SET_META ("VC1"); SET_META ("VC1");
} else if (gst_structure_has_name (s, "video/x-vp8")) { } else if (gst_structure_has_name (s, "video/x-vp8")) {