Commit 86b79d66 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (4197): Port new MPEG API to saa7134-empress with saa6752hs

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent f022156b
This diff is collapsed.
......@@ -64,8 +64,10 @@ static void ts_reset_encoder(struct saa7134_dev* dev)
static int ts_init_encoder(struct saa7134_dev* dev)
{
struct v4l2_ext_controls ctrls = { V4L2_CTRL_CLASS_MPEG, 0 };
ts_reset_encoder(dev);
saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, NULL);
saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, &ctrls);
dev->empress_started = 1;
return 0;
}
......@@ -162,6 +164,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
struct saa7134_dev *dev = file->private_data;
struct v4l2_ext_controls *ctrls = arg;
if (debug > 1)
v4l_print_ioctl(dev->name,cmd);
......@@ -284,6 +287,21 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
case VIDIOC_G_MPEGCOMP:
saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg);
return 0;
case VIDIOC_S_EXT_CTRLS:
/* count == 0 is abused in saa6752hs.c, so that special
case is handled here explicitly. */
if (ctrls->count == 0)
return 0;
if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
return -EINVAL;
saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, arg);
ts_init_encoder(dev);
return 0;
case VIDIOC_G_EXT_CTRLS:
if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
return -EINVAL;
saa7134_i2c_call_clients(dev, VIDIOC_G_EXT_CTRLS, arg);
return 0;
default:
return -ENOIOCTLCMD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment