From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org, iivanov@mm-sol.com,
gururaj.nagendra@intel.com, david.cohen@nokia.com
Subject: Re: [PATCH v5 5/6] V4L: Events: Support event handling in do_ioctl
Date: Mon, 22 Feb 2010 11:41:50 +0200 [thread overview]
Message-ID: <4B82515E.3030106@maxwell.research.nokia.com> (raw)
In-Reply-To: <3b2a22bbd1fd71331d3407c3653391b4.squirrel@webmail.xs4all.nl>
Hans Verkuil wrote:
>>>>> There is a crucial piece of functionality missing here: if the
>>>>> filehandle is in blocking mode, then it should wait until an event
>>>>> arrives. That also means that if vfh->events == NULL, you should
>>> still
>>>>> call v4l2_event_dequeue, and that function should initialize
>>>>> vfh->events and wait for an event if the fh is in blocking mode.
>>>>
>>>> I originally left this out intentionally. Most applications using
>>> events
>>>> would use select / poll as well by default. For completeness it should
>>>> be there, I agree.
>>>
>>> It has to be there. This is important functionality. For e.g. ivtv I
>>> would
>>> use this to wait until the MPEG decoder flushed all buffers and
>>> displayed
>>> the last frame of the stream. That's something you would often do in
>>> blocking mode.
>>
>> Blocking mode can easily be emulated using select().
It's quite simple to implement still so I'll do that in the
VIDIOC_DQEVENT. Easier for applications anyway in use cases that I
haven't been thinking about, e.g. ivtv.
>>>> This btw. suggests that we perhaps should put back the struct file
>>>> argument for the event functions in video_ioctl_ops. The blocking flag
>>>> is indeed part of the file structure. I'm open to better suggestions,
>>>> too.
>>>
>>> My long term goal is that the file struct is only used inside
>>> v4l2-ioctl.c
>>> and not in drivers. Drivers should not need this struct at all. The
>>> easiest
>>> way to ensure this is by not passing it to the drivers at all :-)
>>
>> Drivers still need a way to access the blocking flag. The interim solution
>> of
>> adding a file * member to v4l2_fh would allow that, while still removing
>> most
>> usage of file * from drivers.
>
> Why not just add a 'blocking' argument to the v4l2_event_dequeue? And let
> v4l2-ioctl.c fill in that argument? That's how I would do it.
Implemented already before reading your mail... :-) I'll try to repost
the patches today.
--
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com
next prev parent reply other threads:[~2010-02-22 9:42 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-19 19:21 [PATCH v5 0/6] V4L2 file handles and event interface Sakari Ailus
2010-02-19 19:21 ` [PATCH v5 1/6] V4L: File handles Sakari Ailus
2010-02-19 22:29 ` Aguirre, Sergio
2010-02-19 22:34 ` Laurent Pinchart
2010-02-19 22:54 ` Aguirre, Sergio
2010-02-21 20:22 ` Sakari Ailus
2010-02-22 17:27 ` Aguirre, Sergio
2010-02-22 17:36 ` Sakari Ailus
2010-02-19 19:21 ` [PATCH v5 2/6] V4L: File handles: Add documentation Sakari Ailus
2010-02-20 9:59 ` Hans Verkuil
2010-02-19 19:21 ` [PATCH v5 3/6] V4L: Events: Add new ioctls for events Sakari Ailus
2010-02-19 19:21 ` [PATCH v5 4/6] V4L: Events: Add backend Sakari Ailus
2010-02-19 22:46 ` Aguirre, Sergio
2010-02-21 20:25 ` Sakari Ailus
2010-02-20 9:45 ` Hans Verkuil
2010-02-21 20:57 ` Sakari Ailus
2010-02-22 7:56 ` Hans Verkuil
2010-02-19 19:21 ` [PATCH v5 5/6] V4L: Events: Support event handling in do_ioctl Sakari Ailus
2010-02-20 9:56 ` Hans Verkuil
2010-02-21 22:31 ` Sakari Ailus
2010-02-21 22:54 ` Laurent Pinchart
2010-02-22 7:37 ` Sakari Ailus
2010-02-22 7:53 ` Hans Verkuil
2010-02-22 9:10 ` Laurent Pinchart
2010-02-22 9:21 ` Hans Verkuil
2010-02-22 9:41 ` Sakari Ailus [this message]
2010-02-19 19:22 ` [PATCH v5 6/6] V4L: Events: Add documentation Sakari Ailus
2010-02-20 10:15 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B82515E.3030106@maxwell.research.nokia.com \
--to=sakari.ailus@maxwell.research.nokia.com \
--cc=david.cohen@nokia.com \
--cc=gururaj.nagendra@intel.com \
--cc=hverkuil@xs4all.nl \
--cc=iivanov@mm-sol.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox