From a63451ecd7ce8f8a1a01a8f30d97510cd73ca6b5 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Mon, 16 Apr 2012 22:08:21 +0000 Subject: [PATCH] v4l2src: Add H264 encoded stream support to the caps This is not enough to properly support H264 cameras, but it will allow an H264 stream to be generated by v4l2src using the default settings of the camera. If used with the pre-set-format signal, the H264 encoder can be fully configured. Conflicts: sys/v4l2/gstv4l2object.c --- sys/v4l2/gstv4l2object.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 6bcbf16b89..533b8b7e62 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -880,6 +880,8 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = { {V4L2_PIX_FMT_DV, TRUE}, {V4L2_PIX_FMT_MPEG, FALSE}, + {V4L2_PIX_FMT_H264, TRUE}, + /* Vendor-specific formats */ {V4L2_PIX_FMT_WNVA, TRUE}, @@ -1199,6 +1201,9 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc) case V4L2_PIX_FMT_HI240: /* 8 8-bit color */ /* FIXME: get correct fourccs here */ break; + case V4L2_PIX_FMT_H264: /* H.264 */ + structure = gst_structure_new ("video/x-h264", NULL); + break; case V4L2_PIX_FMT_RGB332: case V4L2_PIX_FMT_RGB555X: case V4L2_PIX_FMT_RGB565X: @@ -1471,6 +1476,8 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps, fourcc = V4L2_PIX_FMT_DV; } else if (g_str_equal (mimetype, "image/jpeg")) { fourcc = V4L2_PIX_FMT_JPEG; + } else if (g_str_equal (mimetype, "video/x-h264")) { + fourcc = V4L2_PIX_FMT_H264; #ifdef V4L2_PIX_FMT_SBGGR8 } else if (g_str_equal (mimetype, "video/x-bayer")) { fourcc = V4L2_PIX_FMT_SBGGR8;