v4l2: fix compilation on older v4l2

Fix compilation on systems where the H264 format is not defined.
This commit is contained in:
Wim Taymans 2012-04-19 12:38:58 +02:00
parent 04b70571e5
commit 85d4dde9d1

View file

@ -880,7 +880,9 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = {
{V4L2_PIX_FMT_DV, TRUE},
{V4L2_PIX_FMT_MPEG, FALSE},
#ifdef V4L2_PIX_FMT_H264
{V4L2_PIX_FMT_H264, TRUE},
#endif
/* Vendor-specific formats */
{V4L2_PIX_FMT_WNVA, TRUE},
@ -1201,9 +1203,11 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
case V4L2_PIX_FMT_HI240: /* 8 8-bit color */
/* FIXME: get correct fourccs here */
break;
#ifdef V4L2_PIX_FMT_H264
case V4L2_PIX_FMT_H264: /* H.264 */
structure = gst_structure_new_empty ("video/x-h264");
break;
#endif
case V4L2_PIX_FMT_RGB332:
case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_RGB565X:
@ -1476,8 +1480,10 @@ 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;
#ifdef V4L2_PIX_FMT_H264
} else if (g_str_equal (mimetype, "video/x-h264")) {
fourcc = V4L2_PIX_FMT_H264;
#endif
#ifdef V4L2_PIX_FMT_SBGGR8
} else if (g_str_equal (mimetype, "video/x-bayer")) {
fourcc = V4L2_PIX_FMT_SBGGR8;