CameraManager and Integration with Cheese



Hi,

I've started writing something I'm going to call probably GCam or CameraManager. The intention of the code is to behave more or less like NetworkManager/nm-applet except with capture devices.

The first part is a lightweight daemon (gcamd) that uses libudev to monitor for new video4linux devices, checks that they have at least one "camera" input and sends a signal out on dbus with the device node, as unique an ID as possible, and the event (add, remove, etc). My plans are to expand the daemon to be able to store camera/device configuration (v4l2 controls, etc) in an sqlite3 database. Ideally, what it should do is, when the camera (or any v4l2 capture device) is detected/plugged-in, it's "unique" ID is looked up in the config database and the controls values are applied to the device. I guess the daemon will need to accept an "update" method over dbus or something to tell it to (re)store the settings in the database. I'll probably get this last stuff working over next weekend.

The second part is a GtkStatusIcon-based app (also supports app-indicator, to some extent), that sits in the panel. When it gets the signals from the dbus daemon, it uses libnotify to popup a bubble to tell the user that the system detected a "camera" being connected/disconnected. When you click on the status icon, it drops down a menu of v4l2 capture devices, and in their submenus it shows the "camera" inputs on the device, with a OK icon if v4l2 doesn't give any bad status flags, and a X icon when there's a bad status flag (no power, no signal, etc). When you hover your mouse over the camera menu item, it sends a tooltip-notify signal to a custom tooltip window which renders a video into GdkPixbuf/window. I took a screenshot[1] to better show what it looks like. Currently I'm using my libfg2[2] library for getting the video but I'm considering switching to GStreamer if it's fast enough (the tooltip preview window has to popup pretty darn fast).

The next step is to determine what happens when the user clicks the camera's menu item. I've had several ideas, including:

1) Writing a simple GStreamer/GTK+ app that just shows the live feed, nothing more. 2) Writing a nice (and comprehensive) GTK+ control application with preview that allows tons of configuration for the device (calling a dbus method on the above mentioned daemon to store the changed settings). 3) Opening Cheese with the selected device activated (my favourite option) and patching it to call the dbus method to store the settings when changed in Cheese. I haven't checked if Cheese is using v4l2 controls or GStreamer elements (or both) to control camera settings.

I was hoping to solicit feedback and/or help from anyone interested in any and all of the above. So I have a few questions:

  - Does this seem like something that should/could become part of Cheese?

- Should my panel 'applet' just shell out to cheese or should there be tighter integration? Maybe option 1) or 2) is better?

  - Are there any ideas to improve the daemon/gtk app?

- I haven't found anything online, but am I duplicating efforts here, is there something like this already (or in planning)?

  - Is anyone interested in helping out with this?

I should have code pushed to my GitHub[3] account by the end of this coming weekend, I haven't done so yet because I'm re-writing the daemon to remove GLib/GDBus due to the (relatively) massive overhead it imposed on my lightweight system daemon.

P.S. Sorry for the long message.

[1] http://imageshack.us/photo/my-images/195/gcamscreenshot.png/
[2] https://github.com/codebrainz/libfg2
[3] https://github.com/codebrainz

Cheers,
Matthew Brush


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]