diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-10-11 05:38:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-22 10:01:30 -0400 |
commit | 3bcc95760c9ee7adb8509173b78914339baa7f4f (patch) | |
tree | 46eb04c847a1eb5bf5c03d90f48487c7cc02c13a /drivers/media | |
parent | 22c4a4e98ece0eaff13b3d0ac73c5283013eb6b1 (diff) |
V4L/DVB (6321): Remove obsolete VIDIOC_S/G_MPEGCOMP ioctls
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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx88/cx88-blackbird.c | 57 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa6752hs.c | 111 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 11 | ||||
-rw-r--r-- | drivers/media/video/v4l2-common.c | 2 | ||||
-rw-r--r-- | drivers/media/video/videodev.c | 42 |
5 files changed, 0 insertions, 223 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index 6d6f5048d762..f33f0b47142c 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -527,44 +527,6 @@ static void blackbird_codec_settings(struct cx8802_dev *dev) | |||
527 | cx2341x_update(dev, blackbird_mbox_func, NULL, &dev->params); | 527 | cx2341x_update(dev, blackbird_mbox_func, NULL, &dev->params); |
528 | } | 528 | } |
529 | 529 | ||
530 | static struct v4l2_mpeg_compression default_mpeg_params = { | ||
531 | .st_type = V4L2_MPEG_PS_2, | ||
532 | .st_bitrate = { | ||
533 | .mode = V4L2_BITRATE_CBR, | ||
534 | .min = 0, | ||
535 | .target = 0, | ||
536 | .max = 0 | ||
537 | }, | ||
538 | .ts_pid_pmt = 16, | ||
539 | .ts_pid_audio = 260, | ||
540 | .ts_pid_video = 256, | ||
541 | .ts_pid_pcr = 259, | ||
542 | .ps_size = 0, | ||
543 | .au_type = V4L2_MPEG_AU_2_II, | ||
544 | .au_bitrate = { | ||
545 | .mode = V4L2_BITRATE_CBR, | ||
546 | .min = 224, | ||
547 | .target = 224, | ||
548 | .max = 224 | ||
549 | }, | ||
550 | .au_sample_rate = 48000, | ||
551 | .au_pesid = 0, | ||
552 | .vi_type = V4L2_MPEG_VI_2, | ||
553 | .vi_aspect_ratio = V4L2_MPEG_ASPECT_4_3, | ||
554 | .vi_bitrate = { | ||
555 | .mode = V4L2_BITRATE_CBR, | ||
556 | .min = 4000, | ||
557 | .target = 4500, | ||
558 | .max = 6000 | ||
559 | }, | ||
560 | .vi_frame_rate = 25, | ||
561 | .vi_frames_per_gop = 12, | ||
562 | .vi_bframes_count = 2, | ||
563 | .vi_pesid = 0, | ||
564 | .closed_gops = 1, | ||
565 | .pulldown = 0 | ||
566 | }; | ||
567 | |||
568 | static int blackbird_initialize_codec(struct cx8802_dev *dev) | 530 | static int blackbird_initialize_codec(struct cx8802_dev *dev) |
569 | { | 531 | { |
570 | struct cx88_core *core = dev->core; | 532 | struct cx88_core *core = dev->core; |
@@ -852,23 +814,6 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) | |||
852 | return videobuf_streamoff(&fh->mpegq); | 814 | return videobuf_streamoff(&fh->mpegq); |
853 | } | 815 | } |
854 | 816 | ||
855 | static int vidioc_g_mpegcomp (struct file *file, void *fh, | ||
856 | struct v4l2_mpeg_compression *f) | ||
857 | { | ||
858 | printk(KERN_WARNING "VIDIOC_G_MPEGCOMP is obsolete. " | ||
859 | "Replace with VIDIOC_G_EXT_CTRLS!"); | ||
860 | memcpy(f,&default_mpeg_params,sizeof(*f)); | ||
861 | return 0; | ||
862 | } | ||
863 | |||
864 | static int vidioc_s_mpegcomp (struct file *file, void *fh, | ||
865 | struct v4l2_mpeg_compression *f) | ||
866 | { | ||
867 | printk(KERN_WARNING "VIDIOC_S_MPEGCOMP is obsolete. " | ||
868 | "Replace with VIDIOC_S_EXT_CTRLS!"); | ||
869 | return 0; | ||
870 | } | ||
871 | |||
872 | static int vidioc_g_ext_ctrls (struct file *file, void *priv, | 817 | static int vidioc_g_ext_ctrls (struct file *file, void *priv, |
873 | struct v4l2_ext_controls *f) | 818 | struct v4l2_ext_controls *f) |
874 | { | 819 | { |
@@ -1216,8 +1161,6 @@ static struct video_device cx8802_mpeg_template = | |||
1216 | .vidioc_dqbuf = vidioc_dqbuf, | 1161 | .vidioc_dqbuf = vidioc_dqbuf, |
1217 | .vidioc_streamon = vidioc_streamon, | 1162 | .vidioc_streamon = vidioc_streamon, |
1218 | .vidioc_streamoff = vidioc_streamoff, | 1163 | .vidioc_streamoff = vidioc_streamoff, |
1219 | .vidioc_g_mpegcomp = vidioc_g_mpegcomp, | ||
1220 | .vidioc_s_mpegcomp = vidioc_s_mpegcomp, | ||
1221 | .vidioc_g_ext_ctrls = vidioc_g_ext_ctrls, | 1164 | .vidioc_g_ext_ctrls = vidioc_g_ext_ctrls, |
1222 | .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls, | 1165 | .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls, |
1223 | .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls, | 1166 | .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls, |
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index 57f1f5d409e0..002e70a33a4f 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c | |||
@@ -71,7 +71,6 @@ static const struct v4l2_format v4l2_format_table[] = | |||
71 | 71 | ||
72 | struct saa6752hs_state { | 72 | struct saa6752hs_state { |
73 | struct i2c_client client; | 73 | struct i2c_client client; |
74 | struct v4l2_mpeg_compression old_params; | ||
75 | struct saa6752hs_mpeg_params params; | 74 | struct saa6752hs_mpeg_params params; |
76 | enum saa6752hs_videoformat video_format; | 75 | enum saa6752hs_videoformat video_format; |
77 | v4l2_std_id standard; | 76 | v4l2_std_id standard; |
@@ -161,35 +160,6 @@ static struct saa6752hs_mpeg_params param_defaults = | |||
161 | .au_l2_bitrate = V4L2_MPEG_AUDIO_L2_BITRATE_256K, | 160 | .au_l2_bitrate = V4L2_MPEG_AUDIO_L2_BITRATE_256K, |
162 | }; | 161 | }; |
163 | 162 | ||
164 | static struct v4l2_mpeg_compression old_param_defaults = | ||
165 | { | ||
166 | .st_type = V4L2_MPEG_TS_2, | ||
167 | .st_bitrate = { | ||
168 | .mode = V4L2_BITRATE_CBR, | ||
169 | .target = 7000, | ||
170 | }, | ||
171 | |||
172 | .ts_pid_pmt = 16, | ||
173 | .ts_pid_video = 260, | ||
174 | .ts_pid_audio = 256, | ||
175 | .ts_pid_pcr = 259, | ||
176 | |||
177 | .vi_type = V4L2_MPEG_VI_2, | ||
178 | .vi_aspect_ratio = V4L2_MPEG_ASPECT_4_3, | ||
179 | .vi_bitrate = { | ||
180 | .mode = V4L2_BITRATE_VBR, | ||
181 | .target = 4000, | ||
182 | .max = 6000, | ||
183 | }, | ||
184 | |||
185 | .au_type = V4L2_MPEG_AU_2_II, | ||
186 | .au_bitrate = { | ||
187 | .mode = V4L2_BITRATE_CBR, | ||
188 | .target = 256, | ||
189 | }, | ||
190 | |||
191 | }; | ||
192 | |||
193 | /* ---------------------------------------------------------------------- */ | 163 | /* ---------------------------------------------------------------------- */ |
194 | 164 | ||
195 | static int saa6752hs_chip_command(struct i2c_client* client, | 165 | static int saa6752hs_chip_command(struct i2c_client* client, |
@@ -362,74 +332,6 @@ static void saa6752hs_set_subsampling(struct i2c_client* client, | |||
362 | } | 332 | } |
363 | 333 | ||
364 | 334 | ||
365 | static void saa6752hs_old_set_params(struct i2c_client* client, | ||
366 | struct v4l2_mpeg_compression* params) | ||
367 | { | ||
368 | struct saa6752hs_state *h = i2c_get_clientdata(client); | ||
369 | |||
370 | /* check PIDs */ | ||
371 | if (params->ts_pid_pmt <= MPEG_PID_MAX) { | ||
372 | h->old_params.ts_pid_pmt = params->ts_pid_pmt; | ||
373 | h->params.ts_pid_pmt = params->ts_pid_pmt; | ||
374 | } | ||
375 | if (params->ts_pid_pcr <= MPEG_PID_MAX) { | ||
376 | h->old_params.ts_pid_pcr = params->ts_pid_pcr; | ||
377 | h->params.ts_pid_pcr = params->ts_pid_pcr; | ||
378 | } | ||
379 | if (params->ts_pid_video <= MPEG_PID_MAX) { | ||
380 | h->old_params.ts_pid_video = params->ts_pid_video; | ||
381 | h->params.ts_pid_video = params->ts_pid_video; | ||
382 | } | ||
383 | if (params->ts_pid_audio <= MPEG_PID_MAX) { | ||
384 | h->old_params.ts_pid_audio = params->ts_pid_audio; | ||
385 | h->params.ts_pid_audio = params->ts_pid_audio; | ||
386 | } | ||
387 | |||
388 | /* check bitrate parameters */ | ||
389 | if ((params->vi_bitrate.mode == V4L2_BITRATE_CBR) || | ||
390 | (params->vi_bitrate.mode == V4L2_BITRATE_VBR)) { | ||
391 | h->old_params.vi_bitrate.mode = params->vi_bitrate.mode; | ||
392 | h->params.vi_bitrate_mode = (params->vi_bitrate.mode == V4L2_BITRATE_VBR) ? | ||
393 | V4L2_MPEG_VIDEO_BITRATE_MODE_VBR : V4L2_MPEG_VIDEO_BITRATE_MODE_CBR; | ||
394 | } | ||
395 | if (params->vi_bitrate.mode != V4L2_BITRATE_NONE) | ||
396 | h->old_params.st_bitrate.target = params->st_bitrate.target; | ||
397 | if (params->vi_bitrate.mode != V4L2_BITRATE_NONE) | ||
398 | h->old_params.vi_bitrate.target = params->vi_bitrate.target; | ||
399 | if (params->vi_bitrate.mode == V4L2_BITRATE_VBR) | ||
400 | h->old_params.vi_bitrate.max = params->vi_bitrate.max; | ||
401 | if (params->au_bitrate.mode != V4L2_BITRATE_NONE) | ||
402 | h->old_params.au_bitrate.target = params->au_bitrate.target; | ||
403 | |||
404 | /* aspect ratio */ | ||
405 | if (params->vi_aspect_ratio == V4L2_MPEG_ASPECT_4_3 || | ||
406 | params->vi_aspect_ratio == V4L2_MPEG_ASPECT_16_9) { | ||
407 | h->old_params.vi_aspect_ratio = params->vi_aspect_ratio; | ||
408 | if (params->vi_aspect_ratio == V4L2_MPEG_ASPECT_4_3) | ||
409 | h->params.vi_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3; | ||
410 | else | ||
411 | h->params.vi_aspect = V4L2_MPEG_VIDEO_ASPECT_16x9; | ||
412 | } | ||
413 | |||
414 | /* range checks */ | ||
415 | if (h->old_params.st_bitrate.target > MPEG_TOTAL_TARGET_BITRATE_MAX) | ||
416 | h->old_params.st_bitrate.target = MPEG_TOTAL_TARGET_BITRATE_MAX; | ||
417 | if (h->old_params.vi_bitrate.target > MPEG_VIDEO_TARGET_BITRATE_MAX) | ||
418 | h->old_params.vi_bitrate.target = MPEG_VIDEO_TARGET_BITRATE_MAX; | ||
419 | if (h->old_params.vi_bitrate.max > MPEG_VIDEO_MAX_BITRATE_MAX) | ||
420 | h->old_params.vi_bitrate.max = MPEG_VIDEO_MAX_BITRATE_MAX; | ||
421 | h->params.vi_bitrate = params->vi_bitrate.target; | ||
422 | h->params.vi_bitrate_peak = params->vi_bitrate.max; | ||
423 | if (h->old_params.au_bitrate.target <= 256) { | ||
424 | h->old_params.au_bitrate.target = 256; | ||
425 | h->params.au_l2_bitrate = V4L2_MPEG_AUDIO_L2_BITRATE_256K; | ||
426 | } | ||
427 | else { | ||
428 | h->old_params.au_bitrate.target = 384; | ||
429 | h->params.au_l2_bitrate = V4L2_MPEG_AUDIO_L2_BITRATE_384K; | ||
430 | } | ||
431 | } | ||
432 | |||
433 | static int handle_ctrl(struct saa6752hs_mpeg_params *params, | 335 | static int handle_ctrl(struct saa6752hs_mpeg_params *params, |
434 | struct v4l2_ext_control *ctrl, unsigned int cmd) | 336 | struct v4l2_ext_control *ctrl, unsigned int cmd) |
435 | { | 337 | { |
@@ -697,7 +599,6 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) | |||
697 | return -ENOMEM; | 599 | return -ENOMEM; |
698 | h->client = client_template; | 600 | h->client = client_template; |
699 | h->params = param_defaults; | 601 | h->params = param_defaults; |
700 | h->old_params = old_param_defaults; | ||
701 | h->client.adapter = adap; | 602 | h->client.adapter = adap; |
702 | h->client.addr = addr; | 603 | h->client.addr = addr; |
703 | 604 | ||
@@ -734,23 +635,11 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
734 | { | 635 | { |
735 | struct saa6752hs_state *h = i2c_get_clientdata(client); | 636 | struct saa6752hs_state *h = i2c_get_clientdata(client); |
736 | struct v4l2_ext_controls *ctrls = arg; | 637 | struct v4l2_ext_controls *ctrls = arg; |
737 | struct v4l2_mpeg_compression *old_params = arg; | ||
738 | struct saa6752hs_mpeg_params params; | 638 | struct saa6752hs_mpeg_params params; |
739 | int err = 0; | 639 | int err = 0; |
740 | int i; | 640 | int i; |
741 | 641 | ||
742 | switch (cmd) { | 642 | switch (cmd) { |
743 | case VIDIOC_S_MPEGCOMP: | ||
744 | if (NULL == old_params) { | ||
745 | /* apply settings and start encoder */ | ||
746 | saa6752hs_init(client); | ||
747 | break; | ||
748 | } | ||
749 | saa6752hs_old_set_params(client, old_params); | ||
750 | /* fall through */ | ||
751 | case VIDIOC_G_MPEGCOMP: | ||
752 | *old_params = h->old_params; | ||
753 | break; | ||
754 | case VIDIOC_S_EXT_CTRLS: | 643 | case VIDIOC_S_EXT_CTRLS: |
755 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) | 644 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) |
756 | return -EINVAL; | 645 | return -EINVAL; |
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 0a7d94319685..75d0c5bf46d2 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
@@ -284,17 +284,6 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, | |||
284 | case VIDIOC_S_CTRL: | 284 | case VIDIOC_S_CTRL: |
285 | return saa7134_common_ioctl(dev, cmd, arg); | 285 | return saa7134_common_ioctl(dev, cmd, arg); |
286 | 286 | ||
287 | case VIDIOC_S_MPEGCOMP: | ||
288 | printk(KERN_WARNING "VIDIOC_S_MPEGCOMP is obsolete. " | ||
289 | "Replace with VIDIOC_S_EXT_CTRLS!"); | ||
290 | saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, arg); | ||
291 | ts_init_encoder(dev); | ||
292 | return 0; | ||
293 | case VIDIOC_G_MPEGCOMP: | ||
294 | printk(KERN_WARNING "VIDIOC_G_MPEGCOMP is obsolete. " | ||
295 | "Replace with VIDIOC_G_EXT_CTRLS!"); | ||
296 | saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg); | ||
297 | return 0; | ||
298 | case VIDIOC_S_EXT_CTRLS: | 287 | case VIDIOC_S_EXT_CTRLS: |
299 | /* count == 0 is abused in saa6752hs.c, so that special | 288 | /* count == 0 is abused in saa6752hs.c, so that special |
300 | case is handled here explicitly. */ | 289 | case is handled here explicitly. */ |
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 321249240d05..1141b4bf41ce 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -317,8 +317,6 @@ static const char *v4l2_ioctls[] = { | |||
317 | [_IOC_NR(VIDIOC_ENUM_FMT)] = "VIDIOC_ENUM_FMT", | 317 | [_IOC_NR(VIDIOC_ENUM_FMT)] = "VIDIOC_ENUM_FMT", |
318 | [_IOC_NR(VIDIOC_G_FMT)] = "VIDIOC_G_FMT", | 318 | [_IOC_NR(VIDIOC_G_FMT)] = "VIDIOC_G_FMT", |
319 | [_IOC_NR(VIDIOC_S_FMT)] = "VIDIOC_S_FMT", | 319 | [_IOC_NR(VIDIOC_S_FMT)] = "VIDIOC_S_FMT", |
320 | [_IOC_NR(VIDIOC_G_MPEGCOMP)] = "VIDIOC_G_MPEGCOMP", | ||
321 | [_IOC_NR(VIDIOC_S_MPEGCOMP)] = "VIDIOC_S_MPEGCOMP", | ||
322 | [_IOC_NR(VIDIOC_REQBUFS)] = "VIDIOC_REQBUFS", | 320 | [_IOC_NR(VIDIOC_REQBUFS)] = "VIDIOC_REQBUFS", |
323 | [_IOC_NR(VIDIOC_QUERYBUF)] = "VIDIOC_QUERYBUF", | 321 | [_IOC_NR(VIDIOC_QUERYBUF)] = "VIDIOC_QUERYBUF", |
324 | [_IOC_NR(VIDIOC_G_FBUF)] = "VIDIOC_G_FBUF", | 322 | [_IOC_NR(VIDIOC_G_FBUF)] = "VIDIOC_G_FBUF", |
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 8d8e517b344f..9611c3990285 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -1313,48 +1313,6 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1313 | ret=vfd->vidioc_cropcap(file, fh, p); | 1313 | ret=vfd->vidioc_cropcap(file, fh, p); |
1314 | break; | 1314 | break; |
1315 | } | 1315 | } |
1316 | case VIDIOC_G_MPEGCOMP: | ||
1317 | { | ||
1318 | struct v4l2_mpeg_compression *p=arg; | ||
1319 | |||
1320 | /*FIXME: Several fields not shown */ | ||
1321 | if (!vfd->vidioc_g_mpegcomp) | ||
1322 | break; | ||
1323 | ret=vfd->vidioc_g_mpegcomp(file, fh, p); | ||
1324 | if (!ret) | ||
1325 | dbgarg (cmd, "ts_pid_pmt=%d, ts_pid_audio=%d," | ||
1326 | " ts_pid_video=%d, ts_pid_pcr=%d, " | ||
1327 | "ps_size=%d, au_sample_rate=%d, " | ||
1328 | "au_pesid=%c, vi_frame_rate=%d, " | ||
1329 | "vi_frames_per_gop=%d, " | ||
1330 | "vi_bframes_count=%d, vi_pesid=%c\n", | ||
1331 | p->ts_pid_pmt,p->ts_pid_audio, | ||
1332 | p->ts_pid_video,p->ts_pid_pcr, | ||
1333 | p->ps_size, p->au_sample_rate, | ||
1334 | p->au_pesid, p->vi_frame_rate, | ||
1335 | p->vi_frames_per_gop, | ||
1336 | p->vi_bframes_count, p->vi_pesid); | ||
1337 | break; | ||
1338 | } | ||
1339 | case VIDIOC_S_MPEGCOMP: | ||
1340 | { | ||
1341 | struct v4l2_mpeg_compression *p=arg; | ||
1342 | /*FIXME: Several fields not shown */ | ||
1343 | if (!vfd->vidioc_s_mpegcomp) | ||
1344 | break; | ||
1345 | dbgarg (cmd, "ts_pid_pmt=%d, ts_pid_audio=%d, " | ||
1346 | "ts_pid_video=%d, ts_pid_pcr=%d, ps_size=%d, " | ||
1347 | "au_sample_rate=%d, au_pesid=%c, " | ||
1348 | "vi_frame_rate=%d, vi_frames_per_gop=%d, " | ||
1349 | "vi_bframes_count=%d, vi_pesid=%c\n", | ||
1350 | p->ts_pid_pmt,p->ts_pid_audio, p->ts_pid_video, | ||
1351 | p->ts_pid_pcr, p->ps_size, p->au_sample_rate, | ||
1352 | p->au_pesid, p->vi_frame_rate, | ||
1353 | p->vi_frames_per_gop, p->vi_bframes_count, | ||
1354 | p->vi_pesid); | ||
1355 | ret=vfd->vidioc_s_mpegcomp(file, fh, p); | ||
1356 | break; | ||
1357 | } | ||
1358 | case VIDIOC_G_JPEGCOMP: | 1316 | case VIDIOC_G_JPEGCOMP: |
1359 | { | 1317 | { |
1360 | struct v4l2_jpegcompression *p=arg; | 1318 | struct v4l2_jpegcompression *p=arg; |