提交 f81cf753 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

V4L/DVB (4198): Avoid newer usages of obsoleted experimental MPEGCOMP API

Put old MPEGCOMP API under #if __KERNEL__ and issue warnings when used.
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 86b79d66
...@@ -805,10 +805,14 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file, ...@@ -805,10 +805,14 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file,
{ {
struct v4l2_mpeg_compression *f = arg; struct v4l2_mpeg_compression *f = arg;
printk(KERN_WARNING "VIDIOC_G_MPEGCOMP is obsolete. "
"Replace with VIDIOC_G_EXT_CTRLS!");
memcpy(f,&default_mpeg_params,sizeof(*f)); memcpy(f,&default_mpeg_params,sizeof(*f));
return 0; return 0;
} }
case VIDIOC_S_MPEGCOMP: case VIDIOC_S_MPEGCOMP:
printk(KERN_WARNING "VIDIOC_S_MPEGCOMP is obsolete. "
"Replace with VIDIOC_S_EXT_CTRLS!");
return 0; return 0;
case VIDIOC_G_EXT_CTRLS: case VIDIOC_G_EXT_CTRLS:
{ {
......
...@@ -281,10 +281,14 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, ...@@ -281,10 +281,14 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
return saa7134_common_ioctl(dev, cmd, arg); return saa7134_common_ioctl(dev, cmd, arg);
case VIDIOC_S_MPEGCOMP: case VIDIOC_S_MPEGCOMP:
printk(KERN_WARNING "VIDIOC_S_MPEGCOMP is obsolete. "
"Replace with VIDIOC_S_EXT_CTRLS!");
saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, arg); saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, arg);
ts_init_encoder(dev); ts_init_encoder(dev);
return 0; return 0;
case VIDIOC_G_MPEGCOMP: case VIDIOC_G_MPEGCOMP:
printk(KERN_WARNING "VIDIOC_G_MPEGCOMP is obsolete. "
"Replace with VIDIOC_G_EXT_CTRLS!");
saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg); saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg);
return 0; return 0;
case VIDIOC_S_EXT_CTRLS: case VIDIOC_S_EXT_CTRLS:
......
...@@ -1216,6 +1216,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ...@@ -1216,6 +1216,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
case VIDIOC_G_MPEGCOMP: case VIDIOC_G_MPEGCOMP:
{ {
struct v4l2_mpeg_compression *p=arg; struct v4l2_mpeg_compression *p=arg;
/*FIXME: Several fields not shown */ /*FIXME: Several fields not shown */
if (!vfd->vidioc_g_mpegcomp) if (!vfd->vidioc_g_mpegcomp)
break; break;
......
...@@ -306,11 +306,13 @@ struct v4l2_timecode ...@@ -306,11 +306,13 @@ struct v4l2_timecode
#define V4L2_TC_USERBITS_8BITCHARS 0x0008 #define V4L2_TC_USERBITS_8BITCHARS 0x0008
/* The above is based on SMPTE timecodes */ /* The above is based on SMPTE timecodes */
#ifdef __KERNEL__
/* /*
* M P E G C O M P R E S S I O N P A R A M E T E R S * M P E G C O M P R E S S I O N P A R A M E T E R S
* *
* ### WARNING: this is still work-in-progress right now, most likely * ### WARNING: This experimental MPEG compression API is obsolete.
* ### there will be some incompatible changes. * ### It is replaced by the MPEG controls API.
* ### This old API will disappear in the near future!
* *
*/ */
enum v4l2_bitrate_mode { enum v4l2_bitrate_mode {
...@@ -390,6 +392,7 @@ struct v4l2_mpeg_compression { ...@@ -390,6 +392,7 @@ struct v4l2_mpeg_compression {
/* I don't expect the above being perfect yet ;) */ /* I don't expect the above being perfect yet ;) */
__u32 reserved_5[8]; __u32 reserved_5[8];
}; };
#endif
struct v4l2_jpegcompression struct v4l2_jpegcompression
{ {
...@@ -1185,8 +1188,10 @@ struct v4l2_streamparm ...@@ -1185,8 +1188,10 @@ struct v4l2_streamparm
#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
#ifdef __KERNEL__
#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
#endif
#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册