linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: V4L2 spec / core questions
Date: Tue, 22 Jan 2013 19:50:31 +0100	[thread overview]
Message-ID: <50FEDF77.50102@googlemail.com> (raw)
In-Reply-To: <201301212239.58876.hverkuil@xs4all.nl>

Am 21.01.2013 22:39, schrieb Hans Verkuil:
> On Mon January 21 2013 22:25:37 Frank Schäfer wrote:
>> Hi Hans,
>>
>> Am 21.01.2013 09:59, schrieb Hans Verkuil:
>>> On Sun January 20 2013 22:15:51 Frank Schäfer wrote:
>>>> Hi Hans,
>>>>
>>>> I noticed that there's code in the v4l2 core that enables/disables
>>>> ioctls and checks some of the parameters depending on the device type.
>>>> While reading the code an comparing it to the V4L2 API document, some
>>>> more questions came up:
>>>>
>>>> 1) Video devices with VBI functionality:
>>>> The spec says: "To address the problems of finding related video and VBI
>>>> devices VBI capturing and output is also available as device function
>>>> under /dev/video".
>>>> Is that still valid ?
>>> No, that's not valid. It really was never valid: most drivers didn't implement
>>> this, and those that did likely didn't work. During one of the media summits
>>> we decided not to allow this. Allowing VBI functionality in video node has a
>>> number of problems:
>>>
>>> 1) it's confusing: why have a vbi node at all if you can do it with a video
>>> node as well? 
>> Yeah, although I think the problem described in the spec document is real.
>> No idea how good applications are in finding the correct VBI device
>> belonging to a specific video device node...
>>
>> Hmm... yeah... why have separate device nodes at all ? We could provide
>> the same functionality with a single device node (e.g. /dev/multimediaX).
>> I assume separation into radio / video / vbi device nodes gears towards
>> typical feature sets of applications.
>> Probably something to think about for V4L3... ;)
> This is an ongoing issue for many years. Laurent and Sakari are working
> on a library that apps can call that tries to find these related devices.
> For drivers that implement the media controller API the MC device can be
> used to obtain this information.

Ok, thanks. I'll keep that in mind.

[snip]
>>>> Btw: function determine_valid_ioctls() in v4l2-dev.c is a good summary
>>>> that explains which ioctls are suitable for which device types
>>>> (radio/video/vbi).
>>>> Converting its content into a table would be a great
>>>> extension/clarifaction of the V4L2 API spec document !
>>> We played around with the idea of 'profiles' where for each type of device
>>> you have a table listing what can and cannot be done. The problem is time...
>>>
>>> If you are interesting in pursuing this, then I am happy to help with advice
>>> and pointers (v4l2-compliance is also a great source of information).
>> I could create a simple html table with X = device type, Y = ioctl.
> That would be a good start!

I've put it on my ToDo list.

>> One last question:
>> I'm looking for a possibility to disable all ioctls when the device is
>> unplugged.
>> I think this is a common problem/task of all drivers for hotpluggable
>> devices, because the disconnect callbacks can't unregister the device
>> until it get's closed by the application.
>> What's the best way to do this ? v4l2_disable_ioctl() has no effect
>> after video_register_device() is called...
> Call video_unregister_device() on disconnect. After that any file operation
> call will be handled by the core and do the right thing on disconnect.

Great, that means we can remove many code lines from the em28xx driver.

Thanks for you help,
Frank


      reply	other threads:[~2013-01-22 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 21:15 V4L2 spec / core questions Frank Schäfer
2013-01-21  8:59 ` Hans Verkuil
2013-01-21 21:25   ` Frank Schäfer
2013-01-21 21:39     ` Hans Verkuil
2013-01-22 18:50       ` Frank Schäfer [this message]

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=50FEDF77.50102@googlemail.com \
    --to=fschaefer.oss@googlemail.com \
    --cc=hverkuil@xs4all.nl \
    --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;
as well as URLs for NNTP newsgroup(s).