Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#7 Add simple read/write settings to qcset

open
Kurt Wall
None
5
2006-05-02
2005-03-30
Kalin KOZHUHAROV
No

I thought that is a good place to implement it, so I
added two new options in qcset.c:

-s r Settings read (from STDIN)
-s w Settings write (to STDOUT)
I am not sure about the last line added (argv += c;),
but seems to work.

So you can do:

qcset /dev/v4l/video0 -s w >settings.dump
(experiment something, say qcset /dev/v4l/video0 -b 3456)
qcset /dev/v4l/video0 -s r <settings.dump

Of course, works if you have enabled keepsettings when
loading the module (modprobe quickcam keepsettings=1).

Code is a bit dirty, but an idea that works.

Discussion

  • qcset-settings.patch

     
    Attachments
  • Logged In: NO

    Nice patch, I'll apply it after some more error checking (I'm
    paranoid). Even better would
    be if you could save & restore the other settings
    too like "quality=xxx", etc...
    On the other hand now it works with all devices
    not just QuickCams.

    argv += c is just all right; c is zero if you write
    option and argument together like "-sw".
    I should switch to using getopt() sometime...
    maybe.

     
  • Kurt Wall
    Kurt Wall
    2006-05-02

    • assigned_to: nobody --> krwall