diff options
Diffstat (limited to 'drivers/media/video/zoran_driver.c')
-rw-r--r-- | drivers/media/video/zoran_driver.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index b5a576a37fd2..9711f6248ef7 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c | |||
@@ -73,6 +73,7 @@ | |||
73 | ) | 73 | ) |
74 | 74 | ||
75 | #include <linux/videodev.h> | 75 | #include <linux/videodev.h> |
76 | #include <media/v4l2-common.h> | ||
76 | #include "videocodec.h" | 77 | #include "videocodec.h" |
77 | 78 | ||
78 | #include <asm/io.h> | 79 | #include <asm/io.h> |
@@ -2047,7 +2048,7 @@ zoran_do_ioctl (struct inode *inode, | |||
2047 | dprintk(3, KERN_DEBUG "%s: VIDIOCGCAP\n", ZR_DEVNAME(zr)); | 2048 | dprintk(3, KERN_DEBUG "%s: VIDIOCGCAP\n", ZR_DEVNAME(zr)); |
2048 | 2049 | ||
2049 | memset(vcap, 0, sizeof(struct video_capability)); | 2050 | memset(vcap, 0, sizeof(struct video_capability)); |
2050 | strncpy(vcap->name, ZR_DEVNAME(zr), sizeof(vcap->name)); | 2051 | strncpy(vcap->name, ZR_DEVNAME(zr), sizeof(vcap->name)-1); |
2051 | vcap->type = ZORAN_VID_TYPE; | 2052 | vcap->type = ZORAN_VID_TYPE; |
2052 | 2053 | ||
2053 | vcap->channels = zr->card.inputs; | 2054 | vcap->channels = zr->card.inputs; |
@@ -2689,8 +2690,8 @@ zoran_do_ioctl (struct inode *inode, | |||
2689 | dprintk(3, KERN_DEBUG "%s: VIDIOC_QUERYCAP\n", ZR_DEVNAME(zr)); | 2690 | dprintk(3, KERN_DEBUG "%s: VIDIOC_QUERYCAP\n", ZR_DEVNAME(zr)); |
2690 | 2691 | ||
2691 | memset(cap, 0, sizeof(*cap)); | 2692 | memset(cap, 0, sizeof(*cap)); |
2692 | strncpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card)); | 2693 | strncpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card)-1); |
2693 | strncpy(cap->driver, "zoran", sizeof(cap->driver)); | 2694 | strncpy(cap->driver, "zoran", sizeof(cap->driver)-1); |
2694 | snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", | 2695 | snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", |
2695 | pci_name(zr->pci_dev)); | 2696 | pci_name(zr->pci_dev)); |
2696 | cap->version = | 2697 | cap->version = |
@@ -2742,7 +2743,7 @@ zoran_do_ioctl (struct inode *inode, | |||
2742 | memset(fmt, 0, sizeof(*fmt)); | 2743 | memset(fmt, 0, sizeof(*fmt)); |
2743 | fmt->index = index; | 2744 | fmt->index = index; |
2744 | fmt->type = type; | 2745 | fmt->type = type; |
2745 | strncpy(fmt->description, zoran_formats[i].name, 31); | 2746 | strncpy(fmt->description, zoran_formats[i].name, sizeof(fmt->description)-1); |
2746 | fmt->pixelformat = zoran_formats[i].fourcc; | 2747 | fmt->pixelformat = zoran_formats[i].fourcc; |
2747 | if (zoran_formats[i].flags & ZORAN_FORMAT_COMPRESSED) | 2748 | if (zoran_formats[i].flags & ZORAN_FORMAT_COMPRESSED) |
2748 | fmt->flags |= V4L2_FMT_FLAG_COMPRESSED; | 2749 | fmt->flags |= V4L2_FMT_FLAG_COMPRESSED; |
@@ -3566,16 +3567,16 @@ zoran_do_ioctl (struct inode *inode, | |||
3566 | 3567 | ||
3567 | switch (ctrl->id) { | 3568 | switch (ctrl->id) { |
3568 | case V4L2_CID_BRIGHTNESS: | 3569 | case V4L2_CID_BRIGHTNESS: |
3569 | strncpy(ctrl->name, "Brightness", 31); | 3570 | strncpy(ctrl->name, "Brightness", sizeof(ctrl->name)-1); |
3570 | break; | 3571 | break; |
3571 | case V4L2_CID_CONTRAST: | 3572 | case V4L2_CID_CONTRAST: |
3572 | strncpy(ctrl->name, "Contrast", 31); | 3573 | strncpy(ctrl->name, "Contrast", sizeof(ctrl->name)-1); |
3573 | break; | 3574 | break; |
3574 | case V4L2_CID_SATURATION: | 3575 | case V4L2_CID_SATURATION: |
3575 | strncpy(ctrl->name, "Saturation", 31); | 3576 | strncpy(ctrl->name, "Saturation", sizeof(ctrl->name)-1); |
3576 | break; | 3577 | break; |
3577 | case V4L2_CID_HUE: | 3578 | case V4L2_CID_HUE: |
3578 | strncpy(ctrl->name, "Hue", 31); | 3579 | strncpy(ctrl->name, "Hue", sizeof(ctrl->name)-1); |
3579 | break; | 3580 | break; |
3580 | } | 3581 | } |
3581 | 3582 | ||
@@ -3693,7 +3694,7 @@ zoran_do_ioctl (struct inode *inode, | |||
3693 | &caps); | 3694 | &caps); |
3694 | if (caps.flags & VIDEO_DECODER_AUTO) { | 3695 | if (caps.flags & VIDEO_DECODER_AUTO) { |
3695 | std->id = V4L2_STD_ALL; | 3696 | std->id = V4L2_STD_ALL; |
3696 | strncpy(std->name, "Autodetect", 31); | 3697 | strncpy(std->name, "Autodetect", sizeof(std->name)-1); |
3697 | return 0; | 3698 | return 0; |
3698 | } else | 3699 | } else |
3699 | return -EINVAL; | 3700 | return -EINVAL; |
@@ -3701,21 +3702,21 @@ zoran_do_ioctl (struct inode *inode, | |||
3701 | switch (std->index) { | 3702 | switch (std->index) { |
3702 | case 0: | 3703 | case 0: |
3703 | std->id = V4L2_STD_PAL; | 3704 | std->id = V4L2_STD_PAL; |
3704 | strncpy(std->name, "PAL", 31); | 3705 | strncpy(std->name, "PAL", sizeof(std->name)-1); |
3705 | std->frameperiod.numerator = 1; | 3706 | std->frameperiod.numerator = 1; |
3706 | std->frameperiod.denominator = 25; | 3707 | std->frameperiod.denominator = 25; |
3707 | std->framelines = zr->card.tvn[0]->Ht; | 3708 | std->framelines = zr->card.tvn[0]->Ht; |
3708 | break; | 3709 | break; |
3709 | case 1: | 3710 | case 1: |
3710 | std->id = V4L2_STD_NTSC; | 3711 | std->id = V4L2_STD_NTSC; |
3711 | strncpy(std->name, "NTSC", 31); | 3712 | strncpy(std->name, "NTSC", sizeof(std->name)-1); |
3712 | std->frameperiod.numerator = 1001; | 3713 | std->frameperiod.numerator = 1001; |
3713 | std->frameperiod.denominator = 30000; | 3714 | std->frameperiod.denominator = 30000; |
3714 | std->framelines = zr->card.tvn[1]->Ht; | 3715 | std->framelines = zr->card.tvn[1]->Ht; |
3715 | break; | 3716 | break; |
3716 | case 2: | 3717 | case 2: |
3717 | std->id = V4L2_STD_SECAM; | 3718 | std->id = V4L2_STD_SECAM; |
3718 | strncpy(std->name, "SECAM", 31); | 3719 | strncpy(std->name, "SECAM", sizeof(std->name)-1); |
3719 | std->frameperiod.numerator = 1; | 3720 | std->frameperiod.numerator = 1; |
3720 | std->frameperiod.denominator = 25; | 3721 | std->frameperiod.denominator = 25; |
3721 | std->framelines = zr->card.tvn[2]->Ht; | 3722 | std->framelines = zr->card.tvn[2]->Ht; |
@@ -3871,7 +3872,7 @@ zoran_do_ioctl (struct inode *inode, | |||
3871 | memset(outp, 0, sizeof(*outp)); | 3872 | memset(outp, 0, sizeof(*outp)); |
3872 | outp->index = 0; | 3873 | outp->index = 0; |
3873 | outp->type = V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY; | 3874 | outp->type = V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY; |
3874 | strncpy(outp->name, "Autodetect", 31); | 3875 | strncpy(outp->name, "Autodetect", sizeof(outp->name)-1); |
3875 | 3876 | ||
3876 | return 0; | 3877 | return 0; |
3877 | } | 3878 | } |