mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 05:47:35 +07:00
media: pvrusb2: correctly return V4L2_PIX_FMT_MPEG in enum_fmt
The pvrusb2 code appears to have a some old workaround code for xawtv that causes a WARN() due to an unrecognized pixelformat 0 in v4l2_ioctl.c. Since all other MPEG drivers fill this in correctly, it is a safe assumption that this particular problem no longer exists. While I'm at it, clean up the code a bit. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
327553ae8e
commit
c4b72ee8ac
@ -78,18 +78,6 @@ static int vbi_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1};
|
|||||||
module_param_array(vbi_nr, int, NULL, 0444);
|
module_param_array(vbi_nr, int, NULL, 0444);
|
||||||
MODULE_PARM_DESC(vbi_nr, "Offset for device's vbi dev minor");
|
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_PIX 0
|
||||||
#define PVR_FORMAT_VBI 1
|
#define PVR_FORMAT_VBI 1
|
||||||
|
|
||||||
@ -99,17 +87,11 @@ static struct v4l2_format pvr_format [] = {
|
|||||||
.fmt = {
|
.fmt = {
|
||||||
.pix = {
|
.pix = {
|
||||||
.width = 720,
|
.width = 720,
|
||||||
.height = 576,
|
.height = 576,
|
||||||
// This should really be V4L2_PIX_FMT_MPEG,
|
.pixelformat = V4L2_PIX_FMT_MPEG,
|
||||||
// but xawtv breaks when I do that.
|
|
||||||
.pixelformat = 0, // V4L2_PIX_FMT_MPEG,
|
|
||||||
.field = V4L2_FIELD_INTERLACED,
|
.field = V4L2_FIELD_INTERLACED,
|
||||||
.bytesperline = 0, // doesn't make sense
|
/* FIXME : Don't know what to put here... */
|
||||||
// here
|
.sizeimage = 32 * 1024,
|
||||||
//FIXME : Don't know what to put here...
|
|
||||||
.sizeimage = (32*1024),
|
|
||||||
.colorspace = 0, // doesn't make sense here
|
|
||||||
.priv = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -409,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)
|
static int pvr2_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *fd)
|
||||||
{
|
{
|
||||||
/* Only one format is supported : mpeg.*/
|
/* Only one format is supported: MPEG. */
|
||||||
if (fd->index != 0)
|
if (fd->index)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
memcpy(fd, pvr_fmtdesc, sizeof(struct v4l2_fmtdesc));
|
fd->pixelformat = V4L2_PIX_FMT_MPEG;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user