From: <wt...@ke...> - 2008-05-26 14:52:58
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: wtay Date: Mon May 26 2008 14:53:05 UTC Log message: Patch by: William M. Brack <wbrack at mmm dot com dot hk> * sys/v4l2/gstv4l2src.c: (gst_v4l2src_v4l2fourcc_to_structure), (gst_v4l2_get_caps_info): Add NV12, NV21 and bayer support. See #520092. Modified files: . : ChangeLog sys/v4l2 : gstv4l2src.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3488&r2=1.3489 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/sys/v4l2/gstv4l2src.c.diff?r1=1.91&r2=1.92 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.3488 retrieving revision 1.3489 diff -u -d -r1.3488 -r1.3489 --- ChangeLog 26 May 2008 13:51:36 -0000 1.3488 +++ ChangeLog 26 May 2008 14:52:50 -0000 1.3489 @@ -1,5 +1,13 @@ 2008-05-26 Wim Taymans <wim...@co...> + Patch by: William M. Brack <wbrack at mmm dot com dot hk> + + * sys/v4l2/gstv4l2src.c: (gst_v4l2src_v4l2fourcc_to_structure), + (gst_v4l2_get_caps_info): + Add NV12, NV21 and bayer support. See #520092. +2008-05-26 Wim Taymans <wim...@co...> * gst/qtdemux/qtdemux.c: (gst_qtdemux_find_segment), (gst_qtdemux_activate_segment): Unbreak segment activation again. Fixes #531672. Index: gstv4l2src.c RCS file: /cvs/gstreamer/gst-plugins-good/sys/v4l2/gstv4l2src.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- gstv4l2src.c 17 May 2008 10:38:18 -0000 1.91 +++ gstv4l2src.c 26 May 2008 14:52:51 -0000 1.92 @@ -537,12 +537,12 @@ break; } case V4L2_PIX_FMT_GREY: /* 8 Greyscale */ - case V4L2_PIX_FMT_NV12: /* 12 Y/CbCr 4:2:0 */ - case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */ case V4L2_PIX_FMT_YYUV: /* 16 YUV 4:2:2 */ case V4L2_PIX_FMT_HI240: /* 8 8-bit color */ /* FIXME: get correct fourccs here */ + case V4L2_PIX_FMT_NV12: /* 12 Y/CbCr 4:2:0 */ + case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */ case V4L2_PIX_FMT_YVU410: case V4L2_PIX_FMT_YUV410: case V4L2_PIX_FMT_YUV420: /* I420/IYUV */ @@ -555,6 +555,12 @@ guint32 fcc = 0; switch (fourcc) { + case V4L2_PIX_FMT_NV12: + fcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); + break; + case V4L2_PIX_FMT_NV21: + fcc = GST_MAKE_FOURCC ('N', 'V', '2', '1'); case V4L2_PIX_FMT_YVU410: fcc = GST_MAKE_FOURCC ('Y', 'V', 'U', '9'); break; @@ -790,6 +796,16 @@ outsize = GST_ROUND_UP_4 (*w) * *h; outsize += 2 * ((GST_ROUND_UP_8 (*w) / 2) * *h); break; + case GST_MAKE_FOURCC ('N', 'V', '1', '2'): + fourcc = V4L2_PIX_FMT_NV12; + outsize = GST_ROUND_UP_4 (*w) * GST_ROUND_UP_2 (*h); + outsize += (GST_ROUND_UP_4 (*w) * *h) / 2; + break; + case GST_MAKE_FOURCC ('N', 'V', '2', '1'): + fourcc = V4L2_PIX_FMT_NV21; } else if (!strcmp (mimetype, "video/x-raw-rgb")) { gint depth, endianness, r_mask; @@ -821,6 +837,8 @@ fourcc = V4L2_PIX_FMT_DV; } else if (strcmp (mimetype, "image/jpeg") == 0) { fourcc = V4L2_PIX_FMT_JPEG; + } else if (strcmp (mimetype, "video/x-raw-bayer") == 0) { + fourcc = V4L2_PIX_FMT_SBGGR8; } if (fourcc == 0) |