[0.10] gst-plugins-good: v4l2src: Add H264 encoded stream support to the caps

Sebastian Dröge slomo at kemper.freedesktop.org
Thu Apr 19 00:27:29 PDT 2012


Module: gst-plugins-good
Branch: 0.10
Commit: 7097762a01b1a6eac47aea2c79b47da85b69efc0
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=7097762a01b1a6eac47aea2c79b47da85b69efc0

Author: Youness Alaoui <youness.alaoui at collabora.co.uk>
Date:   Mon Apr 16 22:08:21 2012 +0000

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.

---

 sys/v4l2/gstv4l2object.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 6ff5ab4..bbe6e2d 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -840,6 +840,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},
 
@@ -1155,6 +1157,9 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
     case V4L2_PIX_FMT_JPEG:    /* JFIF JPEG */
       structure = gst_structure_new ("image/jpeg", NULL);
       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_RGB555:
     case V4L2_PIX_FMT_RGB555X:
@@ -1513,6 +1518,8 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
     fourcc = V4L2_PIX_FMT_DV;
   } else if (strcmp (mimetype, "image/jpeg") == 0) {
     fourcc = V4L2_PIX_FMT_JPEG;
+  } else if (strcmp (mimetype, "video/x-h264") == 0) {
+    fourcc = V4L2_PIX_FMT_H264;
 #ifdef V4L2_PIX_FMT_SBGGR8
   } else if (strcmp (mimetype, "video/x-raw-bayer") == 0) {
     fourcc = V4L2_PIX_FMT_SBGGR8;



More information about the gstreamer-commits mailing list