mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
sys/v4l2/gstv4l2src.c: Add NV12, NV21 and bayer support. See #520092.
Original commit message from CVS: 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.
This commit is contained in:
parent
afc9d66fbf
commit
c3bde2dc42
2 changed files with 28 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-05-26 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
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.taymans@collabora.co.uk>
|
2008-05-26 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* gst/qtdemux/qtdemux.c: (gst_qtdemux_find_segment),
|
* gst/qtdemux/qtdemux.c: (gst_qtdemux_find_segment),
|
||||||
|
|
|
@ -537,12 +537,12 @@ gst_v4l2src_v4l2fourcc_to_structure (guint32 fourcc)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case V4L2_PIX_FMT_GREY: /* 8 Greyscale */
|
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_YYUV: /* 16 YUV 4:2:2 */
|
||||||
case V4L2_PIX_FMT_HI240: /* 8 8-bit color */
|
case V4L2_PIX_FMT_HI240: /* 8 8-bit color */
|
||||||
/* FIXME: get correct fourccs here */
|
/* FIXME: get correct fourccs here */
|
||||||
break;
|
break;
|
||||||
|
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_YVU410:
|
||||||
case V4L2_PIX_FMT_YUV410:
|
case V4L2_PIX_FMT_YUV410:
|
||||||
case V4L2_PIX_FMT_YUV420: /* I420/IYUV */
|
case V4L2_PIX_FMT_YUV420: /* I420/IYUV */
|
||||||
|
@ -555,6 +555,12 @@ gst_v4l2src_v4l2fourcc_to_structure (guint32 fourcc)
|
||||||
guint32 fcc = 0;
|
guint32 fcc = 0;
|
||||||
|
|
||||||
switch (fourcc) {
|
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');
|
||||||
|
break;
|
||||||
case V4L2_PIX_FMT_YVU410:
|
case V4L2_PIX_FMT_YVU410:
|
||||||
fcc = GST_MAKE_FOURCC ('Y', 'V', 'U', '9');
|
fcc = GST_MAKE_FOURCC ('Y', 'V', 'U', '9');
|
||||||
break;
|
break;
|
||||||
|
@ -790,6 +796,16 @@ gst_v4l2_get_caps_info (GstV4l2Src * v4l2src, GstCaps * caps,
|
||||||
outsize = GST_ROUND_UP_4 (*w) * *h;
|
outsize = GST_ROUND_UP_4 (*w) * *h;
|
||||||
outsize += 2 * ((GST_ROUND_UP_8 (*w) / 2) * *h);
|
outsize += 2 * ((GST_ROUND_UP_8 (*w) / 2) * *h);
|
||||||
break;
|
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;
|
||||||
|
outsize = GST_ROUND_UP_4 (*w) * GST_ROUND_UP_2 (*h);
|
||||||
|
outsize += (GST_ROUND_UP_4 (*w) * *h) / 2;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (!strcmp (mimetype, "video/x-raw-rgb")) {
|
} else if (!strcmp (mimetype, "video/x-raw-rgb")) {
|
||||||
gint depth, endianness, r_mask;
|
gint depth, endianness, r_mask;
|
||||||
|
@ -821,6 +837,8 @@ gst_v4l2_get_caps_info (GstV4l2Src * v4l2src, GstCaps * caps,
|
||||||
fourcc = V4L2_PIX_FMT_DV;
|
fourcc = V4L2_PIX_FMT_DV;
|
||||||
} else if (strcmp (mimetype, "image/jpeg") == 0) {
|
} else if (strcmp (mimetype, "image/jpeg") == 0) {
|
||||||
fourcc = V4L2_PIX_FMT_JPEG;
|
fourcc = V4L2_PIX_FMT_JPEG;
|
||||||
|
} else if (strcmp (mimetype, "video/x-raw-bayer") == 0) {
|
||||||
|
fourcc = V4L2_PIX_FMT_SBGGR8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fourcc == 0)
|
if (fourcc == 0)
|
||||||
|
|
Loading…
Reference in a new issue