diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-07 09:41:13 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-07 09:41:13 -0300 |
commit | 200d1e76b68ff2fc92caa1b89aeaeee1f146ae3e (patch) | |
tree | 452d8db8c77c3d93709229bf7e9d01fdeaacaf4e /linux/drivers/media/video/videodev.c | |
parent | 0c8a03efa72c55b8afac86637a5dea2cc69033ae (diff) | |
download | mediapointer-dvb-s2-200d1e76b68ff2fc92caa1b89aeaeee1f146ae3e.tar.gz mediapointer-dvb-s2-200d1e76b68ff2fc92caa1b89aeaeee1f146ae3e.tar.bz2 |
Fixes some errors on *FMT functions
From: Mauro Carvalho Chehab <mchehab@infradead.org>
memset() were being called on wrong places;
At the right places where memset() is required, the type value were being
lost.
Inserted also debug functions to VIDEO_CAPTURE buffers on *_FMT ioctls.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/videodev.c')
-rw-r--r-- | linux/drivers/media/video/videodev.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c index e372394f5..b3285d753 100644 --- a/linux/drivers/media/video/videodev.c +++ b/linux/drivers/media/video/videodev.c @@ -355,7 +355,7 @@ static inline void dbgrect(struct video_device *vfd, char *s, static inline void v4l_print_pix_fmt (struct video_device *vfd, struct v4l2_pix_format *fmt) { - dbgarg2 ("width=%d, height=%d, format=%d, field=%s, " + dbgarg2 ("width=%d, height=%d, format=0x%08x, field=%s, " "bytesperline=%d sizeimage=%d, colorspace=%d\n", fmt->width,fmt->height,fmt->pixelformat, prt_names(fmt->field,v4l2_field_names_FIXME), @@ -513,7 +513,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, if (!ret) dbgarg (cmd, "index=%d, type=%d, flags=%d, " "description=%s," - " pixelformat=%d\n", + " pixelformat=0x%8x\n", f->index, f->type, f->flags, f->description, f->pixelformat); @@ -523,19 +523,21 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_G_FMT: { struct v4l2_format *f = (struct v4l2_format *)arg; - enum v4l2_buf_type type=f->type; memset(&f->fmt.pix,0,sizeof(f->fmt.pix)); + f->type=type; /* FIXME: Should be one dump per type */ - dbgarg (cmd, "type=%s\n", prt_names(f->type, + dbgarg (cmd, "type=%s\n", prt_names(type, v4l2_type_names_FIXME)); switch (type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: if (vfd->vidioc_g_fmt_cap) ret=vfd->vidioc_g_fmt_cap(file, fh, f); + if (!ret) + v4l_print_pix_fmt(vfd,&f->fmt.pix); break; case V4L2_BUF_TYPE_VIDEO_OVERLAY: if (vfd->vidioc_g_fmt_overlay) @@ -574,16 +576,14 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_S_FMT: { struct v4l2_format *f = (struct v4l2_format *)arg; - enum v4l2_buf_type type=f->type; - - memset(&f->fmt.pix,0,sizeof(f->fmt.pix)); /* FIXME: Should be one dump per type */ dbgarg (cmd, "type=%s\n", prt_names(f->type, v4l2_type_names_FIXME)); - switch (type) { + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: + v4l_print_pix_fmt(vfd,&f->fmt.pix); if (vfd->vidioc_s_fmt_cap) ret=vfd->vidioc_s_fmt_cap(file, fh, f); break; @@ -624,17 +624,16 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_TRY_FMT: { struct v4l2_format *f = (struct v4l2_format *)arg; - enum v4l2_buf_type type=f->type; - - memset(&f->fmt.pix,0,sizeof(f->fmt.pix)); /* FIXME: Should be one dump per type */ dbgarg (cmd, "type=%s\n", prt_names(f->type, v4l2_type_names_FIXME)); - switch (type) { + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: if (vfd->vidioc_try_fmt_cap) ret=vfd->vidioc_try_fmt_cap(file, fh, f); + if (!ret) + v4l_print_pix_fmt(vfd,&f->fmt.pix); break; case V4L2_BUF_TYPE_VIDEO_OVERLAY: if (vfd->vidioc_try_fmt_overlay) |