summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-05-16 10:24:06 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-05-16 10:24:06 +0200
commitae437d00b6b62d7a84f666b2c3a01e0e3967bf88 (patch)
tree612a57ce99806500a51b67112fa834d17117cfca /modules
parentbf556745ef22c3ebae47b29cee79141c0c33cbd9 (diff)
v4l2_codec: add check for V4L2_PIX_FMT_H264 define
Diffstat (limited to 'modules')
-rw-r--r--modules/v4l2_codec/v4l2_codec.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/v4l2_codec/v4l2_codec.c b/modules/v4l2_codec/v4l2_codec.c
index 08ec746..c32955b 100644
--- a/modules/v4l2_codec/v4l2_codec.c
+++ b/modules/v4l2_codec/v4l2_codec.c
@@ -119,12 +119,16 @@ static int print_caps(int fd, unsigned width, unsigned height)
info(" Formats:\n");
while (0 == xioctl(fd, VIDIOC_ENUM_FMT, &fmtdesc)) {
- bool selected = fmtdesc.pixelformat == V4L2_PIX_FMT_H264;
+ bool selected = false;
strncpy(fourcc, (char *)&fmtdesc.pixelformat, 4);
- if (fmtdesc.pixelformat == V4L2_PIX_FMT_H264)
- support_h264 = true;
+#ifdef V4L2_PIX_FMT_H264
+ if (fmtdesc.pixelformat == V4L2_PIX_FMT_H264) {
+ support_h264 = true;
+ selected = true;
+ }
+#endif
c = fmtdesc.flags & V4L2_FMT_FLAG_COMPRESSED ? 'C' : ' ';
@@ -145,7 +149,9 @@ static int print_caps(int fd, unsigned width, unsigned height)
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = width;
fmt.fmt.pix.height = height;
+#ifdef V4L2_PIX_FMT_H264
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_H264;
+#endif
fmt.fmt.pix.field = V4L2_FIELD_NONE;
if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt)) {