aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-11-24 07:53:43 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-02-14 10:41:42 -0500
commita45c0ad51d344dad18c6fb67304b4f87cf0ffd59 (patch)
treeacdd8cac43a26db7f5d993adffb5e7e6a2634498 /drivers/media
parent32d7e63c1f4f86ad18404e3f36be99c9910fae9b (diff)
[media] v4l2: add VIDIOC_(TRY_)DECODER_CMD
As discussed during the 2011 V4L-DVB workshop, the API in dvb/video.h should be replaced by a proper V4L2 API. This patch turns the VIDEO_(TRY_)DECODER_CMD ioctls into proper V4L2 ioctls. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/v4l2-compat-ioctl32.c2
-rw-r--r--drivers/media/video/v4l2-ioctl.c28
2 files changed, 30 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c
index af4419e6c658..e6f67aa5b4c0 100644
--- a/drivers/media/video/v4l2-compat-ioctl32.c
+++ b/drivers/media/video/v4l2-compat-ioctl32.c
@@ -1005,6 +1005,8 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
1005 case VIDIOC_G_ENC_INDEX: 1005 case VIDIOC_G_ENC_INDEX:
1006 case VIDIOC_ENCODER_CMD: 1006 case VIDIOC_ENCODER_CMD:
1007 case VIDIOC_TRY_ENCODER_CMD: 1007 case VIDIOC_TRY_ENCODER_CMD:
1008 case VIDIOC_DECODER_CMD:
1009 case VIDIOC_TRY_DECODER_CMD:
1008 case VIDIOC_DBG_S_REGISTER: 1010 case VIDIOC_DBG_S_REGISTER:
1009 case VIDIOC_DBG_G_REGISTER: 1011 case VIDIOC_DBG_G_REGISTER:
1010 case VIDIOC_DBG_G_CHIP_IDENT: 1012 case VIDIOC_DBG_G_CHIP_IDENT:
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index d0d7281e01e0..a288ee6fd456 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -260,6 +260,8 @@ static const char *v4l2_ioctls[] = {
260 [_IOC_NR(VIDIOC_ENCODER_CMD)] = "VIDIOC_ENCODER_CMD", 260 [_IOC_NR(VIDIOC_ENCODER_CMD)] = "VIDIOC_ENCODER_CMD",
261 [_IOC_NR(VIDIOC_TRY_ENCODER_CMD)] = "VIDIOC_TRY_ENCODER_CMD", 261 [_IOC_NR(VIDIOC_TRY_ENCODER_CMD)] = "VIDIOC_TRY_ENCODER_CMD",
262 262
263 [_IOC_NR(VIDIOC_DECODER_CMD)] = "VIDIOC_DECODER_CMD",
264 [_IOC_NR(VIDIOC_TRY_DECODER_CMD)] = "VIDIOC_TRY_DECODER_CMD",
263 [_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER", 265 [_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER",
264 [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER", 266 [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER",
265 267
@@ -1764,6 +1766,32 @@ static long __video_do_ioctl(struct file *file,
1764 dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); 1766 dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
1765 break; 1767 break;
1766 } 1768 }
1769 case VIDIOC_DECODER_CMD:
1770 {
1771 struct v4l2_decoder_cmd *p = arg;
1772
1773 if (!ops->vidioc_decoder_cmd)
1774 break;
1775 if (ret_prio) {
1776 ret = ret_prio;
1777 break;
1778 }
1779 ret = ops->vidioc_decoder_cmd(file, fh, p);
1780 if (!ret)
1781 dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
1782 break;
1783 }
1784 case VIDIOC_TRY_DECODER_CMD:
1785 {
1786 struct v4l2_decoder_cmd *p = arg;
1787
1788 if (!ops->vidioc_try_decoder_cmd)
1789 break;
1790 ret = ops->vidioc_try_decoder_cmd(file, fh, p);
1791 if (!ret)
1792 dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
1793 break;
1794 }
1767 case VIDIOC_G_PARM: 1795 case VIDIOC_G_PARM:
1768 { 1796 {
1769 struct v4l2_streamparm *p = arg; 1797 struct v4l2_streamparm *p = arg;