public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: Andrea <audetto@tiscali.it>
Cc: video4linux-list@redhat.com
Subject: Re: prototype of a USB v4l2 driver? gspca?
Date: Sun, 13 Jul 2008 21:29:03 +0200	[thread overview]
Message-ID: <487A577F.8080300@hhs.nl> (raw)
In-Reply-To: <4879E767.4000103@tiscali.it>

Andrea wrote:
> Hans de Goede wrote:
>> Andrea wrote:
>>
>> What kind of device, I think that for webcams you;re best using gspca, 
>> (now merged in mecurial), that handles all the usb specific stuff, 
>> buffer management, etc. In general it makes it easy to write a webcam 
>> driver allowing you to focus on the interaction with the cam, rather 
>> then having to worry about looking, usb specifics, buffer management etc.
>>
> 
> I've had a quick look at the structure of gspca, and it seems that any 
> subdriver should just (easier to say that to do) fill one of those 
> structures
> 

Correct.

> struct sd_desc {
> /* information */
>     const char *name;    /* sub-driver name */
> /* controls */
>     const struct ctrl *ctrls;
>     int nctrls;
> /* operations */
>     cam_cf_op config;    /* called on probe */
>     cam_op open;        /* called on open */
>     cam_v_op start;        /* called on stream on */
>     cam_v_op stopN;        /* called on stream off - main alt */
>     cam_v_op stop0;        /* called on stream off - alt 0 */
>     cam_v_op close;        /* called on close */
>     cam_pkt_op pkt_scan;
> /* optional operations */
>     cam_v_op dq_callback;    /* called when a frame has been dequeued */
>     cam_jpg_op get_jcomp;
>     cam_jpg_op set_jcomp;
>     cam_qmnu_op querymenu;
> };
> 
> 1) providing ctrls (+ functions to handle settings)
> 2) functions to open/stream/close etc...
> 
> It does not seem too bad.
> 

It isn't.

> The a natural question that comes to me:
> 
> Shouldn't many more USB drivers be implemented as subdrivers of gspca?

Yes that would remove lots of code duplication, but allas they were written 
before gspca (version 2, as you currently see in mercurial) was around.

Regards,

Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

  reply	other threads:[~2008-07-13 19:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-12 19:40 prototype of a USB v4l2 driver? Andrea
2008-07-12 19:59 ` Hans de Goede
2008-07-13  8:39   ` Andrea
2008-07-13 11:30   ` prototype of a USB v4l2 driver? gspca? Andrea
2008-07-13 19:29     ` Hans de Goede [this message]
2008-07-17 15:31       ` Markus Rechberger
2008-07-17 15:34         ` Hans de Goede
2008-07-17 16:19           ` Markus Rechberger
2008-07-17 21:10           ` Andrea

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=487A577F.8080300@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --cc=audetto@tiscali.it \
    --cc=video4linux-list@redhat.com \
    /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