summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-v4l2.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index 11cdfe356801..ad6290e1b699 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -78,18 +78,6 @@ static int vbi_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1};
module_param_array(vbi_nr, int, NULL, 0444);
MODULE_PARM_DESC(vbi_nr, "Offset for device's vbi dev minor");
-static struct v4l2_fmtdesc pvr_fmtdesc [] = {
- {
- .index = 0,
- .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
- .flags = V4L2_FMT_FLAG_COMPRESSED,
- .description = "MPEG1/2",
- // This should really be V4L2_PIX_FMT_MPEG, but xawtv
- // breaks when I do that.
- .pixelformat = 0, // V4L2_PIX_FMT_MPEG,
- }
-};
-
#define PVR_FORMAT_PIX 0
#define PVR_FORMAT_VBI 1
@@ -99,17 +87,11 @@ static struct v4l2_format pvr_format [] = {
.fmt = {
.pix = {
.width = 720,
- .height = 576,
- // This should really be V4L2_PIX_FMT_MPEG,
- // but xawtv breaks when I do that.
- .pixelformat = 0, // V4L2_PIX_FMT_MPEG,
+ .height = 576,
+ .pixelformat = V4L2_PIX_FMT_MPEG,
.field = V4L2_FIELD_INTERLACED,
- .bytesperline = 0, // doesn't make sense
- // here
- //FIXME : Don't know what to put here...
- .sizeimage = (32*1024),
- .colorspace = 0, // doesn't make sense here
- .priv = 0
+ /* FIXME : Don't know what to put here... */
+ .sizeimage = 32 * 1024,
}
}
},
@@ -153,6 +135,8 @@ static int pvr2_querycap(struct file *file, void *priv, struct v4l2_capability *
case VFL_TYPE_RADIO:
cap->device_caps = V4L2_CAP_RADIO;
break;
+ default:
+ return -EINVAL;
}
cap->device_caps |= V4L2_CAP_TUNER | V4L2_CAP_READWRITE;
return 0;
@@ -407,11 +391,11 @@ static int pvr2_g_frequency(struct file *file, void *priv, struct v4l2_frequency
static int pvr2_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *fd)
{
- /* Only one format is supported : mpeg.*/
- if (fd->index != 0)
+ /* Only one format is supported: MPEG. */
+ if (fd->index)
return -EINVAL;
- memcpy(fd, pvr_fmtdesc, sizeof(struct v4l2_fmtdesc));
+ fd->pixelformat = V4L2_PIX_FMT_MPEG;
return 0;
}