diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2011-06-28 09:40:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 16:53:20 -0400 |
commit | 5138870d68ffbf6fcdf019af5b2ce78bc5a1f837 (patch) | |
tree | 41a7aac0a33e67679a0d9a5e98775b827fd0d28c /drivers/media/video/ivtv | |
parent | c7a52f8dced9ee325b8e3a16a5ac07d191fc3d9b (diff) |
[media] ivtv: add control event support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 11 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index a7f54b010a5c..353142d01446 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -750,6 +750,7 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait) | |||
750 | struct ivtv *itv = id->itv; | 750 | struct ivtv *itv = id->itv; |
751 | struct ivtv_stream *s = &itv->streams[id->type]; | 751 | struct ivtv_stream *s = &itv->streams[id->type]; |
752 | int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags); | 752 | int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags); |
753 | unsigned res = 0; | ||
753 | 754 | ||
754 | /* Start a capture if there is none */ | 755 | /* Start a capture if there is none */ |
755 | if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags)) { | 756 | if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags)) { |
@@ -769,12 +770,16 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait) | |||
769 | /* add stream's waitq to the poll list */ | 770 | /* add stream's waitq to the poll list */ |
770 | IVTV_DEBUG_HI_FILE("Encoder poll\n"); | 771 | IVTV_DEBUG_HI_FILE("Encoder poll\n"); |
771 | poll_wait(filp, &s->waitq, wait); | 772 | poll_wait(filp, &s->waitq, wait); |
773 | if (v4l2_event_pending(&id->fh)) | ||
774 | res |= POLLPRI; | ||
775 | else | ||
776 | poll_wait(filp, &id->fh.events->wait, wait); | ||
772 | 777 | ||
773 | if (s->q_full.length || s->q_io.length) | 778 | if (s->q_full.length || s->q_io.length) |
774 | return POLLIN | POLLRDNORM; | 779 | return res | POLLIN | POLLRDNORM; |
775 | if (eof) | 780 | if (eof) |
776 | return POLLHUP; | 781 | return res | POLLHUP; |
777 | return 0; | 782 | return res; |
778 | } | 783 | } |
779 | 784 | ||
780 | void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end) | 785 | void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end) |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index 707399893de1..ff75d07097b2 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -1451,6 +1451,8 @@ static int ivtv_subscribe_event(struct v4l2_fh *fh, struct v4l2_event_subscripti | |||
1451 | case V4L2_EVENT_VSYNC: | 1451 | case V4L2_EVENT_VSYNC: |
1452 | case V4L2_EVENT_EOS: | 1452 | case V4L2_EVENT_EOS: |
1453 | break; | 1453 | break; |
1454 | case V4L2_EVENT_CTRL: | ||
1455 | return v4l2_ctrl_subscribe_fh(fh, sub, 0); | ||
1454 | default: | 1456 | default: |
1455 | return -EINVAL; | 1457 | return -EINVAL; |
1456 | } | 1458 | } |