]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6321): Remove obsolete VIDIOC_S/G_MPEGCOMP ioctls
authorHans Verkuil <hverkuil@xs4all.nl>
Thu, 11 Oct 2007 09:38:18 +0000 (06:38 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 22 Oct 2007 14:01:30 +0000 (12:01 -0200)
Remove the obsolete VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP ioctls from
the V4L2 API as per the removal schedule (October 2007).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx88/cx88-blackbird.c
drivers/media/video/saa7134/saa6752hs.c
drivers/media/video/saa7134/saa7134-empress.c
drivers/media/video/v4l2-common.c
drivers/media/video/videodev.c
include/linux/videodev2.h
include/media/v4l2-dev.h

index 6d6f5048d7627a1d3f0923f763caafa0a06ac88e..f33f0b47142cd319b75942ab4d19ec269cb85922 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)
 {
@@ -1216,8 +1161,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,
index 57f1f5d409e0e0f3f11b1b046c4672f57edd16c8..002e70a33a4f6bf2fe847c6223a1a6518f25955a 100644 (file)
@@ -71,7 +71,6 @@ static const struct v4l2_format v4l2_format_table[] =
 
 struct saa6752hs_state {
        struct i2c_client             client;
-       struct v4l2_mpeg_compression  old_params;
        struct saa6752hs_mpeg_params  params;
        enum saa6752hs_videoformat    video_format;
        v4l2_std_id                   standard;
@@ -161,35 +160,6 @@ static struct saa6752hs_mpeg_params param_defaults =
        .au_l2_bitrate   = V4L2_MPEG_AUDIO_L2_BITRATE_256K,
 };
 
-static struct v4l2_mpeg_compression old_param_defaults =
-{
-       .st_type         = V4L2_MPEG_TS_2,
-       .st_bitrate      = {
-               .mode    = V4L2_BITRATE_CBR,
-               .target  = 7000,
-       },
-
-       .ts_pid_pmt      = 16,
-       .ts_pid_video    = 260,
-       .ts_pid_audio    = 256,
-       .ts_pid_pcr      = 259,
-
-       .vi_type         = V4L2_MPEG_VI_2,
-       .vi_aspect_ratio = V4L2_MPEG_ASPECT_4_3,
-       .vi_bitrate      = {
-               .mode    = V4L2_BITRATE_VBR,
-               .target  = 4000,
-               .max     = 6000,
-       },
-
-       .au_type         = V4L2_MPEG_AU_2_II,
-       .au_bitrate      = {
-               .mode    = V4L2_BITRATE_CBR,
-               .target  = 256,
-       },
-
-};
-
 /* ---------------------------------------------------------------------- */
 
 static int saa6752hs_chip_command(struct i2c_client* client,
@@ -362,74 +332,6 @@ static void saa6752hs_set_subsampling(struct i2c_client* client,
 }
 
 
-static void saa6752hs_old_set_params(struct i2c_client* client,
-                                struct v4l2_mpeg_compression* params)
-{
-       struct saa6752hs_state *h = i2c_get_clientdata(client);
-
-       /* check PIDs */
-       if (params->ts_pid_pmt <= MPEG_PID_MAX) {
-               h->old_params.ts_pid_pmt = params->ts_pid_pmt;
-               h->params.ts_pid_pmt = params->ts_pid_pmt;
-       }
-       if (params->ts_pid_pcr <= MPEG_PID_MAX) {
-               h->old_params.ts_pid_pcr = params->ts_pid_pcr;
-               h->params.ts_pid_pcr = params->ts_pid_pcr;
-       }
-       if (params->ts_pid_video <= MPEG_PID_MAX) {
-               h->old_params.ts_pid_video = params->ts_pid_video;
-               h->params.ts_pid_video = params->ts_pid_video;
-       }
-       if (params->ts_pid_audio <= MPEG_PID_MAX) {
-               h->old_params.ts_pid_audio = params->ts_pid_audio;
-               h->params.ts_pid_audio = params->ts_pid_audio;
-       }
-
-       /* check bitrate parameters */
-       if ((params->vi_bitrate.mode == V4L2_BITRATE_CBR) ||
-           (params->vi_bitrate.mode == V4L2_BITRATE_VBR)) {
-               h->old_params.vi_bitrate.mode = params->vi_bitrate.mode;
-               h->params.vi_bitrate_mode = (params->vi_bitrate.mode == V4L2_BITRATE_VBR) ?
-                      V4L2_MPEG_VIDEO_BITRATE_MODE_VBR : V4L2_MPEG_VIDEO_BITRATE_MODE_CBR;
-       }
-       if (params->vi_bitrate.mode != V4L2_BITRATE_NONE)
-               h->old_params.st_bitrate.target = params->st_bitrate.target;
-       if (params->vi_bitrate.mode != V4L2_BITRATE_NONE)
-               h->old_params.vi_bitrate.target = params->vi_bitrate.target;
-       if (params->vi_bitrate.mode == V4L2_BITRATE_VBR)
-               h->old_params.vi_bitrate.max = params->vi_bitrate.max;
-       if (params->au_bitrate.mode != V4L2_BITRATE_NONE)
-               h->old_params.au_bitrate.target = params->au_bitrate.target;
-
-       /* aspect ratio */
-       if (params->vi_aspect_ratio == V4L2_MPEG_ASPECT_4_3 ||
-           params->vi_aspect_ratio == V4L2_MPEG_ASPECT_16_9) {
-               h->old_params.vi_aspect_ratio = params->vi_aspect_ratio;
-               if (params->vi_aspect_ratio == V4L2_MPEG_ASPECT_4_3)
-                       h->params.vi_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3;
-               else
-                       h->params.vi_aspect = V4L2_MPEG_VIDEO_ASPECT_16x9;
-       }
-
-       /* range checks */
-       if (h->old_params.st_bitrate.target > MPEG_TOTAL_TARGET_BITRATE_MAX)
-               h->old_params.st_bitrate.target = MPEG_TOTAL_TARGET_BITRATE_MAX;
-       if (h->old_params.vi_bitrate.target > MPEG_VIDEO_TARGET_BITRATE_MAX)
-               h->old_params.vi_bitrate.target = MPEG_VIDEO_TARGET_BITRATE_MAX;
-       if (h->old_params.vi_bitrate.max > MPEG_VIDEO_MAX_BITRATE_MAX)
-               h->old_params.vi_bitrate.max = MPEG_VIDEO_MAX_BITRATE_MAX;
-       h->params.vi_bitrate = params->vi_bitrate.target;
-       h->params.vi_bitrate_peak = params->vi_bitrate.max;
-       if (h->old_params.au_bitrate.target <= 256) {
-               h->old_params.au_bitrate.target = 256;
-               h->params.au_l2_bitrate = V4L2_MPEG_AUDIO_L2_BITRATE_256K;
-       }
-       else {
-               h->old_params.au_bitrate.target = 384;
-               h->params.au_l2_bitrate = V4L2_MPEG_AUDIO_L2_BITRATE_384K;
-       }
-}
-
 static int handle_ctrl(struct saa6752hs_mpeg_params *params,
                struct v4l2_ext_control *ctrl, unsigned int cmd)
 {
@@ -697,7 +599,6 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind)
                return -ENOMEM;
        h->client = client_template;
        h->params = param_defaults;
-       h->old_params = old_param_defaults;
        h->client.adapter = adap;
        h->client.addr = addr;
 
@@ -734,23 +635,11 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
 {
        struct saa6752hs_state *h = i2c_get_clientdata(client);
        struct v4l2_ext_controls *ctrls = arg;
-       struct v4l2_mpeg_compression *old_params = arg;
        struct saa6752hs_mpeg_params params;
        int err = 0;
        int i;
 
        switch (cmd) {
-       case VIDIOC_S_MPEGCOMP:
-               if (NULL == old_params) {
-                       /* apply settings and start encoder */
-                       saa6752hs_init(client);
-                       break;
-               }
-               saa6752hs_old_set_params(client, old_params);
-               /* fall through */
-       case VIDIOC_G_MPEGCOMP:
-               *old_params = h->old_params;
-               break;
        case VIDIOC_S_EXT_CTRLS:
                if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
                        return -EINVAL;
index 0a7d94319685e93582bd82db0d3f97e0d0a313c3..75d0c5bf46d284def842762960d060304e882a02 100644 (file)
@@ -284,17 +284,6 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
        case VIDIOC_S_CTRL:
                return saa7134_common_ioctl(dev, cmd, arg);
 
-       case VIDIOC_S_MPEGCOMP:
-               printk(KERN_WARNING "VIDIOC_S_MPEGCOMP is obsolete. "
-                                   "Replace with VIDIOC_S_EXT_CTRLS!");
-               saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, arg);
-               ts_init_encoder(dev);
-               return 0;
-       case VIDIOC_G_MPEGCOMP:
-               printk(KERN_WARNING "VIDIOC_G_MPEGCOMP is obsolete. "
-                                   "Replace with VIDIOC_G_EXT_CTRLS!");
-               saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg);
-               return 0;
        case VIDIOC_S_EXT_CTRLS:
                /* count == 0 is abused in saa6752hs.c, so that special
                   case is handled here explicitly. */
index 321249240d058bb2e6eedaf44f635e9db8cbb8bc..1141b4bf41ce059ee69349edeb1ad4fde7315167 100644 (file)
@@ -317,8 +317,6 @@ static const char *v4l2_ioctls[] = {
        [_IOC_NR(VIDIOC_ENUM_FMT)]         = "VIDIOC_ENUM_FMT",
        [_IOC_NR(VIDIOC_G_FMT)]            = "VIDIOC_G_FMT",
        [_IOC_NR(VIDIOC_S_FMT)]            = "VIDIOC_S_FMT",
-       [_IOC_NR(VIDIOC_G_MPEGCOMP)]       = "VIDIOC_G_MPEGCOMP",
-       [_IOC_NR(VIDIOC_S_MPEGCOMP)]       = "VIDIOC_S_MPEGCOMP",
        [_IOC_NR(VIDIOC_REQBUFS)]          = "VIDIOC_REQBUFS",
        [_IOC_NR(VIDIOC_QUERYBUF)]         = "VIDIOC_QUERYBUF",
        [_IOC_NR(VIDIOC_G_FBUF)]           = "VIDIOC_G_FBUF",
index 8d8e517b344f1a46ec3b30db7a4cdad1d9334413..9611c3990285d45133276f22082ec7c4fb8bf73b 100644 (file)
@@ -1313,48 +1313,6 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
                ret=vfd->vidioc_cropcap(file, fh, p);
                break;
        }
-       case VIDIOC_G_MPEGCOMP:
-       {
-               struct v4l2_mpeg_compression *p=arg;
-
-               /*FIXME: Several fields not shown */
-               if (!vfd->vidioc_g_mpegcomp)
-                       break;
-               ret=vfd->vidioc_g_mpegcomp(file, fh, p);
-               if (!ret)
-                       dbgarg (cmd, "ts_pid_pmt=%d, ts_pid_audio=%d,"
-                                       " ts_pid_video=%d, ts_pid_pcr=%d, "
-                                       "ps_size=%d, au_sample_rate=%d, "
-                                       "au_pesid=%c, vi_frame_rate=%d, "
-                                       "vi_frames_per_gop=%d, "
-                                       "vi_bframes_count=%d, vi_pesid=%c\n",
-                                       p->ts_pid_pmt,p->ts_pid_audio,
-                                       p->ts_pid_video,p->ts_pid_pcr,
-                                       p->ps_size, p->au_sample_rate,
-                                       p->au_pesid, p->vi_frame_rate,
-                                       p->vi_frames_per_gop,
-                                       p->vi_bframes_count, p->vi_pesid);
-               break;
-       }
-       case VIDIOC_S_MPEGCOMP:
-       {
-               struct v4l2_mpeg_compression *p=arg;
-               /*FIXME: Several fields not shown */
-               if (!vfd->vidioc_s_mpegcomp)
-                       break;
-               dbgarg (cmd, "ts_pid_pmt=%d, ts_pid_audio=%d, "
-                               "ts_pid_video=%d, ts_pid_pcr=%d, ps_size=%d, "
-                               "au_sample_rate=%d, au_pesid=%c, "
-                               "vi_frame_rate=%d, vi_frames_per_gop=%d, "
-                               "vi_bframes_count=%d, vi_pesid=%c\n",
-                               p->ts_pid_pmt,p->ts_pid_audio, p->ts_pid_video,
-                               p->ts_pid_pcr, p->ps_size, p->au_sample_rate,
-                               p->au_pesid, p->vi_frame_rate,
-                               p->vi_frames_per_gop, p->vi_bframes_count,
-                               p->vi_pesid);
-               ret=vfd->vidioc_s_mpegcomp(file, fh, p);
-               break;
-       }
        case VIDIOC_G_JPEGCOMP:
        {
                struct v4l2_jpegcompression *p=arg;
index 1f503e94eff1491f6a9d98bc92a3e970c226d00f..439474f24e34b63f568828ea76ed5614b34afd9b 100644 (file)
@@ -441,94 +441,6 @@ struct v4l2_timecode
 #define V4L2_TC_USERBITS_8BITCHARS     0x0008
 /* The above is based on SMPTE timecodes */
 
-#ifdef __KERNEL__
-/*
- *     M P E G   C O M P R E S S I O N   P A R A M E T E R S
- *
- *  ### WARNING: This experimental MPEG compression API is obsolete.
- *  ###          It is replaced by the MPEG controls API.
- *  ###          This old API will disappear in the near future!
- *
- */
-enum v4l2_bitrate_mode {
-       V4L2_BITRATE_NONE = 0,  /* not specified */
-       V4L2_BITRATE_CBR,       /* constant bitrate */
-       V4L2_BITRATE_VBR,       /* variable bitrate */
-};
-struct v4l2_bitrate {
-       /* rates are specified in kbit/sec */
-       enum v4l2_bitrate_mode  mode;
-       __u32                   min;
-       __u32                   target;  /* use this one for CBR */
-       __u32                   max;
-};
-
-enum v4l2_mpeg_streamtype {
-       V4L2_MPEG_SS_1,         /* MPEG-1 system stream */
-       V4L2_MPEG_PS_2,         /* MPEG-2 program stream */
-       V4L2_MPEG_TS_2,         /* MPEG-2 transport stream */
-       V4L2_MPEG_PS_DVD,       /* MPEG-2 program stream with DVD header fixups */
-};
-enum v4l2_mpeg_audiotype {
-       V4L2_MPEG_AU_2_I,       /* MPEG-2 layer 1 */
-       V4L2_MPEG_AU_2_II,      /* MPEG-2 layer 2 */
-       V4L2_MPEG_AU_2_III,     /* MPEG-2 layer 3 */
-       V4L2_MPEG_AC3,          /* AC3 */
-       V4L2_MPEG_LPCM,         /* LPCM */
-};
-enum v4l2_mpeg_videotype {
-       V4L2_MPEG_VI_1,         /* MPEG-1 */
-       V4L2_MPEG_VI_2,         /* MPEG-2 */
-};
-enum v4l2_mpeg_aspectratio {
-       V4L2_MPEG_ASPECT_SQUARE = 1,   /* square pixel */
-       V4L2_MPEG_ASPECT_4_3    = 2,   /*  4 : 3       */
-       V4L2_MPEG_ASPECT_16_9   = 3,   /* 16 : 9       */
-       V4L2_MPEG_ASPECT_1_221  = 4,   /*  1 : 2,21    */
-};
-
-struct v4l2_mpeg_compression {
-       /* general */
-       enum v4l2_mpeg_streamtype       st_type;
-       struct v4l2_bitrate             st_bitrate;
-
-       /* transport streams */
-       __u16                           ts_pid_pmt;
-       __u16                           ts_pid_audio;
-       __u16                           ts_pid_video;
-       __u16                           ts_pid_pcr;
-
-       /* program stream */
-       __u16                           ps_size;
-       __u16                           reserved_1;    /* align */
-
-       /* audio */
-       enum v4l2_mpeg_audiotype        au_type;
-       struct v4l2_bitrate             au_bitrate;
-       __u32                           au_sample_rate;
-       __u8                            au_pesid;
-       __u8                            reserved_2[3]; /* align */
-
-       /* video */
-       enum v4l2_mpeg_videotype        vi_type;
-       enum v4l2_mpeg_aspectratio      vi_aspect_ratio;
-       struct v4l2_bitrate             vi_bitrate;
-       __u32                           vi_frame_rate;
-       __u16                           vi_frames_per_gop;
-       __u16                           vi_bframes_count;
-       __u8                            vi_pesid;
-       __u8                            reserved_3[3]; /* align */
-
-       /* misc flags */
-       __u32                           closed_gops:1;
-       __u32                           pulldown:1;
-       __u32                           reserved_4:30; /* align */
-
-       /* I don't expect the above being perfect yet ;) */
-       __u32                           reserved_5[8];
-};
-#endif
-
 struct v4l2_jpegcompression
 {
        int quality;
@@ -1420,10 +1332,6 @@ struct v4l2_chip_ident {
 #define VIDIOC_ENUM_FMT         _IOWR ('V',  2, struct v4l2_fmtdesc)
 #define VIDIOC_G_FMT           _IOWR ('V',  4, struct v4l2_format)
 #define VIDIOC_S_FMT           _IOWR ('V',  5, struct v4l2_format)
-#ifdef __KERNEL__
-#define VIDIOC_G_MPEGCOMP       _IOR  ('V',  6, struct v4l2_mpeg_compression)
-#define VIDIOC_S_MPEGCOMP      _IOW  ('V',  7, struct v4l2_mpeg_compression)
-#endif
 #define VIDIOC_REQBUFS         _IOWR ('V',  8, struct v4l2_requestbuffers)
 #define VIDIOC_QUERYBUF                _IOWR ('V',  9, struct v4l2_buffer)
 #define VIDIOC_G_FBUF          _IOR  ('V', 10, struct v4l2_framebuffer)
index 4c5d66e2da674a822e26a1d515ea00d709f45ba0..c544c6f90893085ad4f73e664dcafdce269653da 100644 (file)
@@ -271,10 +271,6 @@ struct video_device
        int (*vidioc_s_crop)           (struct file *file, void *fh,
                                        struct v4l2_crop *a);
        /* Compression ioctls */
-       int (*vidioc_g_mpegcomp)       (struct file *file, void *fh,
-                                       struct v4l2_mpeg_compression *a);
-       int (*vidioc_s_mpegcomp)       (struct file *file, void *fh,
-                                       struct v4l2_mpeg_compression *a);
        int (*vidioc_g_jpegcomp)       (struct file *file, void *fh,
                                        struct v4l2_jpegcompression *a);
        int (*vidioc_s_jpegcomp)       (struct file *file, void *fh,