diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-04-02 07:34:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-08 05:42:14 -0400 |
commit | 3a29a4f177e99af0d80b5c4396a7aa1e9418742c (patch) | |
tree | 9413a1b0e929e42db0d6eda5e20f387bdc3f4584 | |
parent | eaa80c44d69a790feab29ccb07ced5ac38e98e4d (diff) |
[media] cx18: fix VIDIOC_ENUMINPUT: wrong std value
The std field of v4l2_input is always V4L2_STD_ALL. For tuner inputs
this should be cx->tuner_std.
This fixes a v4l2-compliance failure.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/pci/cx18/cx18-ioctl.c | 8 | ||||
-rw-r--r-- | drivers/media/pci/cx18/cx18-streams.c | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index 6f8324d4be6d..35d75311d0e2 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c | |||
@@ -514,6 +514,9 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp) | |||
514 | { | 514 | { |
515 | struct cx18_open_id *id = fh2id(fh); | 515 | struct cx18_open_id *id = fh2id(fh); |
516 | struct cx18 *cx = id->cx; | 516 | struct cx18 *cx = id->cx; |
517 | v4l2_std_id std = V4L2_STD_ALL; | ||
518 | const struct cx18_card_video_input *card_input = | ||
519 | cx->card->video_inputs + inp; | ||
517 | 520 | ||
518 | if (inp >= cx->nof_inputs) | 521 | if (inp >= cx->nof_inputs) |
519 | return -EINVAL; | 522 | return -EINVAL; |
@@ -529,6 +532,11 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp) | |||
529 | cx->active_input = inp; | 532 | cx->active_input = inp; |
530 | /* Set the audio input to whatever is appropriate for the input type. */ | 533 | /* Set the audio input to whatever is appropriate for the input type. */ |
531 | cx->audio_input = cx->card->video_inputs[inp].audio_index; | 534 | cx->audio_input = cx->card->video_inputs[inp].audio_index; |
535 | if (card_input->video_type == V4L2_INPUT_TYPE_TUNER) | ||
536 | std = cx->tuner_std; | ||
537 | cx->streams[CX18_ENC_STREAM_TYPE_MPG].video_dev.tvnorms = std; | ||
538 | cx->streams[CX18_ENC_STREAM_TYPE_YUV].video_dev.tvnorms = std; | ||
539 | cx->streams[CX18_ENC_STREAM_TYPE_VBI].video_dev.tvnorms = std; | ||
532 | 540 | ||
533 | /* prevent others from messing with the streams until | 541 | /* prevent others from messing with the streams until |
534 | we're finished changing inputs. */ | 542 | we're finished changing inputs. */ |
diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c index cf7ddaf0a704..c82d25d53341 100644 --- a/drivers/media/pci/cx18/cx18-streams.c +++ b/drivers/media/pci/cx18/cx18-streams.c | |||
@@ -304,6 +304,7 @@ static void cx18_stream_init(struct cx18 *cx, int type) | |||
304 | /* Assume the previous pixel default */ | 304 | /* Assume the previous pixel default */ |
305 | s->pixelformat = V4L2_PIX_FMT_HM12; | 305 | s->pixelformat = V4L2_PIX_FMT_HM12; |
306 | s->vb_bytes_per_frame = cx->cxhdl.height * 720 * 3 / 2; | 306 | s->vb_bytes_per_frame = cx->cxhdl.height * 720 * 3 / 2; |
307 | s->vb_bytes_per_line = 720; | ||
307 | } | 308 | } |
308 | } | 309 | } |
309 | 310 | ||
@@ -372,7 +373,10 @@ static int cx18_prep_dev(struct cx18 *cx, int type) | |||
372 | s->video_dev.v4l2_dev = &cx->v4l2_dev; | 373 | s->video_dev.v4l2_dev = &cx->v4l2_dev; |
373 | s->video_dev.fops = &cx18_v4l2_enc_fops; | 374 | s->video_dev.fops = &cx18_v4l2_enc_fops; |
374 | s->video_dev.release = video_device_release_empty; | 375 | s->video_dev.release = video_device_release_empty; |
375 | s->video_dev.tvnorms = V4L2_STD_ALL; | 376 | if (cx->card->video_inputs->video_type == CX18_CARD_INPUT_VID_TUNER) |
377 | s->video_dev.tvnorms = cx->tuner_std; | ||
378 | else | ||
379 | s->video_dev.tvnorms = V4L2_STD_ALL; | ||
376 | s->video_dev.lock = &cx->serialize_lock; | 380 | s->video_dev.lock = &cx->serialize_lock; |
377 | cx18_set_funcs(&s->video_dev); | 381 | cx18_set_funcs(&s->video_dev); |
378 | return 0; | 382 | return 0; |