]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] ivtv: add IVTV_IOC_PASSTHROUGH_MODE
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 15 Dec 2011 13:40:23 +0000 (10:40 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 14 Feb 2012 15:45:56 +0000 (13:45 -0200)
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>
drivers/media/video/ivtv/ivtv-ioctl.c
include/linux/ivtv.h

index cd8032693e6d213814c7d2added63060ad16def0..37ac32b53baf86e969135d3891e7f7aceb0ee122 100644 (file)
@@ -1625,6 +1625,12 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
                return ivtv_yuv_prep_frame(itv, args);
        }
 
+       case IVTV_IOC_PASSTHROUGH_MODE:
+               IVTV_DEBUG_IOCTL("IVTV_IOC_PASSTHROUGH_MODE\n");
+               if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
+                       return -EINVAL;
+               return ivtv_passthrough_mode(itv, *(int *)arg != 0);
+
        case VIDEO_GET_PTS: {
                s64 *pts = arg;
                s64 frame;
@@ -1786,6 +1792,7 @@ static long ivtv_default(struct file *file, void *fh, bool valid_prio,
 
        if (!valid_prio) {
                switch (cmd) {
+               case IVTV_IOC_PASSTHROUGH_MODE:
                case VIDEO_PLAY:
                case VIDEO_STOP:
                case VIDEO_FREEZE:
@@ -1811,6 +1818,7 @@ static long ivtv_default(struct file *file, void *fh, bool valid_prio,
        }
 
        case IVTV_IOC_DMA_FRAME:
+       case IVTV_IOC_PASSTHROUGH_MODE:
        case VIDEO_GET_PTS:
        case VIDEO_GET_FRAME_COUNT:
        case VIDEO_GET_EVENT:
index 062d20f74322795c08fc7651409259f7387c4fe4..42bf725751af03147498732bdc6c16cfb9919a05 100644 (file)
@@ -58,7 +58,11 @@ struct ivtv_dma_frame {
        __u32 src_height;
 };
 
-#define IVTV_IOC_DMA_FRAME  _IOW ('V', BASE_VIDIOC_PRIVATE+0, struct ivtv_dma_frame)
+#define IVTV_IOC_DMA_FRAME             _IOW ('V', BASE_VIDIOC_PRIVATE+0, struct ivtv_dma_frame)
+
+/* Select the passthrough mode (if the argument is non-zero). In the passthrough
+   mode the output of the encoder is passed immediately into the decoder. */
+#define IVTV_IOC_PASSTHROUGH_MODE      _IOW ('V', BASE_VIDIOC_PRIVATE+1, int)
 
 /* Deprecated defines: applications should use the defines from videodev2.h */
 #define IVTV_SLICED_TYPE_TELETEXT_B     V4L2_MPEG_VBI_IVTV_TELETEXT_B