diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2011-12-15 08:40:23 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-02-14 10:45:56 -0500 |
commit | 6e82a6a2a0e895b787f22d28311232cc94fda4b9 (patch) | |
tree | 8b002b1d946d7a5d525ed8f0b84499f1650a2301 | |
parent | 85eeece773a6f0d2ba00958782995cbe68218256 (diff) |
[media] ivtv: add IVTV_IOC_PASSTHROUGH_MODE
With this private ioctl it is possible to use the ivtv decoder without
requiring the dvb/video.h and dvb/audio.h headers.
Eventually support for those DVB APIs will be dropped from ivtv.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 8 | ||||
-rw-r--r-- | include/linux/ivtv.h | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index cd8032693e6d..37ac32b53baf 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -1625,6 +1625,12 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg) | |||
1625 | return ivtv_yuv_prep_frame(itv, args); | 1625 | return ivtv_yuv_prep_frame(itv, args); |
1626 | } | 1626 | } |
1627 | 1627 | ||
1628 | case IVTV_IOC_PASSTHROUGH_MODE: | ||
1629 | IVTV_DEBUG_IOCTL("IVTV_IOC_PASSTHROUGH_MODE\n"); | ||
1630 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | ||
1631 | return -EINVAL; | ||
1632 | return ivtv_passthrough_mode(itv, *(int *)arg != 0); | ||
1633 | |||
1628 | case VIDEO_GET_PTS: { | 1634 | case VIDEO_GET_PTS: { |
1629 | s64 *pts = arg; | 1635 | s64 *pts = arg; |
1630 | s64 frame; | 1636 | s64 frame; |
@@ -1786,6 +1792,7 @@ static long ivtv_default(struct file *file, void *fh, bool valid_prio, | |||
1786 | 1792 | ||
1787 | if (!valid_prio) { | 1793 | if (!valid_prio) { |
1788 | switch (cmd) { | 1794 | switch (cmd) { |
1795 | case IVTV_IOC_PASSTHROUGH_MODE: | ||
1789 | case VIDEO_PLAY: | 1796 | case VIDEO_PLAY: |
1790 | case VIDEO_STOP: | 1797 | case VIDEO_STOP: |
1791 | case VIDEO_FREEZE: | 1798 | case VIDEO_FREEZE: |
@@ -1811,6 +1818,7 @@ static long ivtv_default(struct file *file, void *fh, bool valid_prio, | |||
1811 | } | 1818 | } |
1812 | 1819 | ||
1813 | case IVTV_IOC_DMA_FRAME: | 1820 | case IVTV_IOC_DMA_FRAME: |
1821 | case IVTV_IOC_PASSTHROUGH_MODE: | ||
1814 | case VIDEO_GET_PTS: | 1822 | case VIDEO_GET_PTS: |
1815 | case VIDEO_GET_FRAME_COUNT: | 1823 | case VIDEO_GET_FRAME_COUNT: |
1816 | case VIDEO_GET_EVENT: | 1824 | case VIDEO_GET_EVENT: |
diff --git a/include/linux/ivtv.h b/include/linux/ivtv.h index 062d20f74322..42bf725751af 100644 --- a/include/linux/ivtv.h +++ b/include/linux/ivtv.h | |||
@@ -58,7 +58,11 @@ struct ivtv_dma_frame { | |||
58 | __u32 src_height; | 58 | __u32 src_height; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | #define IVTV_IOC_DMA_FRAME _IOW ('V', BASE_VIDIOC_PRIVATE+0, struct ivtv_dma_frame) | 61 | #define IVTV_IOC_DMA_FRAME _IOW ('V', BASE_VIDIOC_PRIVATE+0, struct ivtv_dma_frame) |
62 | |||
63 | /* Select the passthrough mode (if the argument is non-zero). In the passthrough | ||
64 | mode the output of the encoder is passed immediately into the decoder. */ | ||
65 | #define IVTV_IOC_PASSTHROUGH_MODE _IOW ('V', BASE_VIDIOC_PRIVATE+1, int) | ||
62 | 66 | ||
63 | /* Deprecated defines: applications should use the defines from videodev2.h */ | 67 | /* Deprecated defines: applications should use the defines from videodev2.h */ |
64 | #define IVTV_SLICED_TYPE_TELETEXT_B V4L2_MPEG_VBI_IVTV_TELETEXT_B | 68 | #define IVTV_SLICED_TYPE_TELETEXT_B V4L2_MPEG_VBI_IVTV_TELETEXT_B |