V4L/DVB: ivtv: switch to new vbi subdev ops
[safe/jmp/linux-2.6] / drivers / media / video / ivtv / ivtv-streams.c
index 6917c49..de4288c 100644 (file)
@@ -42,6 +42,7 @@
 #include "ivtv-yuv.h"
 #include "ivtv-cards.h"
 #include "ivtv-streams.h"
+#include <media/v4l2-event.h>
 
 static const struct v4l2_file_operations ivtv_v4l2_enc_fops = {
        .owner = THIS_MODULE,
@@ -343,7 +344,10 @@ static void ivtv_vbi_setup(struct ivtv *itv)
        ivtv_vapi(itv, CX2341X_ENC_SET_VBI_LINE, 5, 0xffff , 0, 0, 0, 0);
 
        /* setup VBI registers */
-       v4l2_subdev_call(itv->sd_video, video, s_fmt, &itv->vbi.in);
+       if (raw)
+               v4l2_subdev_call(itv->sd_video, vbi, s_raw_fmt, &itv->vbi.in.fmt.vbi);
+       else
+               v4l2_subdev_call(itv->sd_video, vbi, s_sliced_fmt, &itv->vbi.in.fmt.sliced);
 
        /* determine number of lines and total number of VBI bytes.
           A raw line takes 1443 bytes: 2 * 720 + 4 byte frame header - 1
@@ -840,6 +844,9 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
 
 int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts)
 {
+       static const struct v4l2_event ev = {
+               .type = V4L2_EVENT_EOS,
+       };
        struct ivtv *itv = s->itv;
 
        if (s->vdev == NULL)
@@ -891,6 +898,7 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts)
 
        set_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags);
        wake_up(&itv->event_waitq);
+       v4l2_event_queue(s->vdev, &ev);
 
        /* wake up wait queues */
        wake_up(&s->waitq);