diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-02-11 09:02:06 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-02-11 09:24:53 -0200 |
commit | 6167b289f12ae9edff5640c8dc95eec102db1ee8 (patch) | |
tree | 6817f1f707ecadf20e87643a1ecc6511c3a51b0e | |
parent | 362a97d43c063809f9d64f9c762f50c382fd4cd3 (diff) |
Provide a more consistent message if FBUF fails
Instead of providing an useless info that FBUF fails, print an
error indicating what's the Fourcc format that fails.
Also, on debug mode, prints a message indicating the selection of a
given fourcc. This helps to verify if both the video adapter and the
video capture board were set to the same video format.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | src/v4l.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -212,6 +212,7 @@ static struct V4L_DEVICE { static int SetV4LFmt(int fd, CARD32 pixelformat) { struct v4l2_framebuffer fbuf; + char *p = (char *)&pixelformat; memset(&fbuf, 0, sizeof(fbuf)); if (ioctl(fd, VIDIOC_G_FBUF, &fbuf) == -1) { @@ -221,10 +222,13 @@ static int SetV4LFmt(int fd, CARD32 pixelformat) if (fbuf.fmt.pixelformat != pixelformat) { fbuf.fmt.pixelformat = pixelformat; if (ioctl(fd, VIDIOC_S_FBUF, &fbuf) == -1) { - xf86Msg(X_ERROR, "v4l: Error %d: Can't set FBUF\n", errno); + xf86Msg(X_ERROR, "v4l: Error %d: Can't set FBUF to %c%c%c%c\n", + errno, p[0], p[1], p[2], p[3]); return errno; } } + DEBUG(xf86Msg(X_INFO, "v4l: Set overlay format to %c%c%c%c\n", + p[0], p[1], p[2], p[3])); return 0; } static int GetV4LFmt(int fd, CARD32 *pixelformat) |