]> err.no Git - linux-2.6/blobdiff - drivers/media/video/cx88/cx88-blackbird.c
V4L/DVB (6602): V4L: Convert videobuf drivers to videobuf_stop
[linux-2.6] / drivers / media / video / cx88 / cx88-blackbird.c
index 47007380a98afb8df38d77bc475192650aec54d4..f802b5653569874fa0a6dbef531c964566c784c8 100644 (file)
@@ -527,44 +527,6 @@ static void blackbird_codec_settings(struct cx8802_dev *dev)
        cx2341x_update(dev, blackbird_mbox_func, NULL, &dev->params);
 }
 
-static struct v4l2_mpeg_compression default_mpeg_params = {
-       .st_type          = V4L2_MPEG_PS_2,
-       .st_bitrate       = {
-               .mode     = V4L2_BITRATE_CBR,
-               .min      = 0,
-               .target   = 0,
-               .max      = 0
-       },
-       .ts_pid_pmt       = 16,
-       .ts_pid_audio     = 260,
-       .ts_pid_video     = 256,
-       .ts_pid_pcr       = 259,
-       .ps_size          = 0,
-       .au_type          = V4L2_MPEG_AU_2_II,
-       .au_bitrate       = {
-               .mode     = V4L2_BITRATE_CBR,
-               .min      = 224,
-               .target   = 224,
-               .max      = 224
-       },
-       .au_sample_rate    = 48000,
-       .au_pesid          = 0,
-       .vi_type           = V4L2_MPEG_VI_2,
-       .vi_aspect_ratio   = V4L2_MPEG_ASPECT_4_3,
-       .vi_bitrate        = {
-               .mode      = V4L2_BITRATE_CBR,
-               .min       = 4000,
-               .target    = 4500,
-               .max       = 6000
-       },
-       .vi_frame_rate     = 25,
-       .vi_frames_per_gop = 12,
-       .vi_bframes_count  = 2,
-       .vi_pesid          = 0,
-       .closed_gops       = 1,
-       .pulldown          = 0
-};
-
 static int blackbird_initialize_codec(struct cx8802_dev *dev)
 {
        struct cx88_core *core = dev->core;
@@ -852,23 +814,6 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
        return videobuf_streamoff(&fh->mpegq);
 }
 
-static int vidioc_g_mpegcomp (struct file *file, void *fh,
-                             struct v4l2_mpeg_compression *f)
-{
-       printk(KERN_WARNING "VIDIOC_G_MPEGCOMP is obsolete. "
-                               "Replace with VIDIOC_G_EXT_CTRLS!");
-       memcpy(f,&default_mpeg_params,sizeof(*f));
-       return 0;
-}
-
-static int vidioc_s_mpegcomp (struct file *file, void *fh,
-                             struct v4l2_mpeg_compression *f)
-{
-       printk(KERN_WARNING "VIDIOC_S_MPEGCOMP is obsolete. "
-                               "Replace with VIDIOC_S_EXT_CTRLS!");
-       return 0;
-}
-
 static int vidioc_g_ext_ctrls (struct file *file, void *priv,
                               struct v4l2_ext_controls *f)
 {
@@ -1077,7 +1022,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
        struct cx8802_driver *drv = NULL;
        int err;
 
-       dev = cx8802_get_device(inode);
+       dev = cx8802_get_device(inode);
 
        dprintk( 1, "%s\n", __FUNCTION__);
 
@@ -1111,7 +1056,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
        file->private_data = fh;
        fh->dev      = dev;
 
-       videobuf_queue_init(&fh->mpegq, &blackbird_qops,
+       videobuf_queue_pci_init(&fh->mpegq, &blackbird_qops,
                            dev->pci, &dev->slock,
                            V4L2_BUF_TYPE_VIDEO_CAPTURE,
                            V4L2_FIELD_INTERLACED,
@@ -1140,10 +1085,7 @@ static int mpeg_release(struct inode *inode, struct file *file)
 
        cx8802_cancel_buffers(fh->dev);
        /* stop mpeg capture */
-       if (fh->mpegq.streaming)
-               videobuf_streamoff(&fh->mpegq);
-       if (fh->mpegq.reading)
-               videobuf_read_stop(&fh->mpegq);
+       videobuf_stop(&fh->mpegq);
 
        videobuf_mmap_free(&fh->mpegq);
        file->private_data = NULL;
@@ -1216,8 +1158,6 @@ static struct video_device cx8802_mpeg_template =
        .vidioc_dqbuf         = vidioc_dqbuf,
        .vidioc_streamon      = vidioc_streamon,
        .vidioc_streamoff     = vidioc_streamoff,
-       .vidioc_g_mpegcomp    = vidioc_g_mpegcomp,
-       .vidioc_s_mpegcomp    = vidioc_s_mpegcomp,
        .vidioc_g_ext_ctrls   = vidioc_g_ext_ctrls,
        .vidioc_s_ext_ctrls   = vidioc_s_ext_ctrls,
        .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls,
@@ -1234,7 +1174,7 @@ static struct video_device cx8802_mpeg_template =
        .vidioc_s_tuner       = vidioc_s_tuner,
        .vidioc_s_std         = vidioc_s_std,
        .tvnorms              = CX88_NORMS,
-       .current_norm         = V4L2_STD_NTSC_M,
+       .current_norm         = V4L2_STD_NTSC_M,
 };
 
 /* ------------------------------------------------------------------ */