From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
Devin Heitmueller <dheitmueller@kernellabs.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [RFCv2] Add a library to retrieve associated media devices - was: Re: [ANNOUNCE] experimental alsa stream support at xawtv3
Date: Sun, 29 May 2011 10:08:44 -0300 [thread overview]
Message-ID: <4DE2455C.1070303@redhat.com> (raw)
In-Reply-To: <4DE233EA.2000400@redhat.com>
Em 29-05-2011 08:54, Hans de Goede escreveu:
> Hi,
>
> On 05/29/2011 01:19 PM, Hans Verkuil wrote:
>> Hi Mauro,
>>
>> Thanks for the RFC! Some initial comments below. I'll hope to do some more
>> testing and reviewing in the coming week.
>>
>
> <Snip>
>
>>> c) get_not_associated_device: Returns the next device not associated with
>>> an specific device type.
>>>
>>> char *get_not_associated_device(void *opaque,
>>> char *last_seek,
>>> enum device_type desired_type,
>>> enum device_type not_desired_type);
>>>
>>> The parameters are:
>>>
>>> opaque: media devices opaque descriptor
>>> last_seek: last seek result. Use NULL to get the first result
>>> desired_type: type of the desired device
>>> not_desired_type: type of the seek device
>>>
>>> This function seeks inside the media_devices struct for the next physical
>>> device that doesn't support a non_desired type.
>>> This method is useful for example to return the audio devices that are
>>> provided by the motherboard.
>>
>> Hmmm. What you really want IMHO is to iterate over 'media hardware', and for
>> each piece of hardware you can find the associated device nodes.
>>
>> It's what you expect to see in an application: a list of USB/PCI/Platform
>> devices to choose from.
>
> This is exactly what I was thinking, I was think along the lines of making
> the device_type enum bitmasks instead, and have a list devices functions,
> which lists all the "physical" media devices as "describing string",
> capabilities pairs, where capabilities would include things like sound
> in / sound out, etc.
A bitmask for device_type in practice means that we'll have just 32 (or 64)
types of devices. Not sure if this is enough in the long term.
Grouping the discovered information together is not hard, but there's one
issue if we'll be opening devices to retrieve additional info: some devices
do weird stuff at open, like retrieving firmware, when the device is waking
from a suspend state. So, the discover procedure that currently happens in
usecs may take seconds. Ok, this is, in fact, a driver and/or hardware trouble,
but I think that having a separate method for it is a good idea.
> And then a function to get a device string (be it a device node
> or an alsa device string, whatever is appropriate) for each capability
> of a device.
get_associated_device()/fget_associated_device() does it. It is generic enough to
work with all types of devices. So, having an alsa device, it can be used
to get the video device associated, or vice-versa.
> This does need some more thought for more complex devices though ...
On complex devices, it may return more than one association.
Cheers,
Mauro.
next prev parent reply other threads:[~2011-05-29 13:08 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-23 20:17 [ANNOUNCE] experimental alsa stream support at xawtv3 Mauro Carvalho Chehab
2011-05-23 20:19 ` Devin Heitmueller
2011-05-23 20:30 ` Mauro Carvalho Chehab
2011-05-23 20:32 ` Mauro Carvalho Chehab
2011-05-24 6:50 ` Hans Verkuil
2011-05-24 7:21 ` Hans de Goede
2011-05-24 14:09 ` Mauro Carvalho Chehab
2011-05-24 15:55 ` Hans de Goede
2011-05-28 12:44 ` Mauro Carvalho Chehab
2011-05-28 13:01 ` Rémi Denis-Courmont
2011-05-28 14:41 ` Mauro Carvalho Chehab
2011-05-28 14:10 ` Mauro Carvalho Chehab
2011-05-28 12:55 ` Rémi Denis-Courmont
2011-05-28 14:39 ` Mauro Carvalho Chehab
2011-05-24 14:15 ` Mauro Carvalho Chehab
2011-05-24 14:57 ` Devin Heitmueller
2011-05-26 6:53 ` Hans Verkuil
2011-05-28 12:17 ` Mauro Carvalho Chehab
2011-05-28 12:26 ` Hans de Goede
2011-05-28 15:24 ` Hans Verkuil
2011-05-28 16:04 ` Mauro Carvalho Chehab
2011-05-28 16:20 ` Mauro Carvalho Chehab
2011-05-29 1:01 ` [RFCv2] Add a library to retrieve associated media devices - was: " Mauro Carvalho Chehab
2011-05-29 11:19 ` Hans Verkuil
2011-05-29 11:47 ` Andy Walls
2011-05-29 12:58 ` Mauro Carvalho Chehab
2011-05-29 11:54 ` Hans de Goede
2011-05-29 13:08 ` Mauro Carvalho Chehab [this message]
2011-05-29 13:30 ` Hans de Goede
2011-05-29 14:55 ` Mauro Carvalho Chehab
2011-05-30 7:14 ` Hans Verkuil
2011-05-30 13:15 ` Mauro Carvalho Chehab
2011-05-29 12:11 ` Mauro Carvalho Chehab
2011-05-29 14:39 ` Mauro Carvalho Chehab
2011-05-30 6:34 ` Hans Verkuil
2011-05-30 11:37 ` Mauro Carvalho Chehab
2011-05-30 6:54 ` Hans Verkuil
2011-05-30 13:03 ` Mauro Carvalho Chehab
2011-05-28 12:00 ` Mauro Carvalho Chehab
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=4DE2455C.1070303@redhat.com \
--to=mchehab@redhat.com \
--cc=dheitmueller@kernellabs.com \
--cc=hdegoede@redhat.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