Skip to content

Instantly share code, notes, and snippets.

@yuvipanda
Created April 5, 2010 09:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save yuvipanda/356202 to your computer and use it in GitHub Desktop.

Spicing up Cheese - Sexier Form and More Function

Goals of the Project

The aim of this project is to make Cheese sexier than it is right now. "It should help its users get laid". This can be accomplished with a slicker UI and a few more features.

Motivation

While Cheese is an easy to use webcam application, it lacks a bit in the coolness department. There are only a limited set of effects, and no live preview. You can't make cool pictures without having to resort to GIMP or Photoshop. I'd like Cheese to be a one-stop cool picture production factory - Take a shot, picking one of several effects shown live to you, and directly post to wherever the user would like to show off (flickr, Facebook, etc).

Deliverables

  1. Entire UI redone in Vala
  2. Vala bindings for clutter-gst
  3. Live Preview for effects
  4. Distributable user created effects.

Gradual Move to Vala/clutter

All of Cheese is written in C/gtk+ now. Moving gradually to Vala/clutter would have the advantage of having a higher level language to write the glue code, and a much slicker UI thanks to clutter.

Moving the UI Chrome to Vala/GTK+

The UI Chrome should obviously remain in GTK+ - so we could reuse the cheese.ui definitions, and convert everything except the viewport to use Vala. When this is done, it will be a 'skeleton' - a frame that does absolutely nothing. It would have a big black space where the Viewport is supposed to be - but everything else would be the same as cheese today.

Moving the Viewport to Vala/clutter

The Viewport will be moved off GTK+ and to clutter. Video preview will be shown using the Video Sink GST Element from clutter-gst. The viewport will be embedded in the GTK+ application, and everything will be done in Vala. Vala bindings for clutter-gst do not exist yet, and will need to be built.

Vala bindings for rest of the code

The libcheese functionality (mainly device detection & camera control) - would remain in C, and be used by the UI bits with Vala bindings. Re-use as much of the non-UI code as possible.

Live Preview

The GStreamer pipeline would be forked after the Camera (+ downscale), passed through separately to each of the currently selected set of effects, and then sunk independently to different sinks (from the clutter-gst library), shown together on the viewport. When the user finally picks an effect, the original pipeline (camera -> filters -> viewport) will be restored with full-resolution video. The current feature of selecting multiple effects to combine them would also be preserved. We can arrange the sinks in multiple ways on the screen, giving us our slick UI (with Transitions, Shadows, etc). Implementation would be in Vala.

A visualization of how this pipeline splitting would work

Note about Hardware Acceleration: GPU based Hardware Acceleration for effects is out of the scope of this project.

Pluggable Effects

There are only a fixed number of effects to choose from in Cheese. Each effect is represented as a sequence of GStreamer Filters, so it should be easy to add a simple plugin mechanism that lets users download packs of new effects and use them. Users can pick between multiple effects packs in the UI. The inbuilt effects will also be rewritten as effect packs.

Effects File Format

The effects files (proposed extension .cheese-effect) will be simple ini files (similar to the .desktop format), with metadata about the effect (Name, Author Name/URL, License, External Dependencies, Colorspace, etc) and the effects string - a sequence of GStreamer Filters seperated by !. This format for specifying the pipeline is universally used across GStreamer, so should be familiar to anyone producing effects. An effect pack is just a collection of .cheese-effect files.

Colorspace Handling

If we have enough time left, we could do automatic colorspace conversion for each GSTreamer filter in that effects string. Otherwise, only the input/output colorspaces for the effect would be specified by the effect author in the .cheese-effect file and Cheese would make sure that the effect recieved input in the proper colorspace. All internal colorspace conversion (if the effect mixes filter that use different colorspaces) would have to be handled by the effect author inserting appropriate conversion filters into the effects string.

External GST Plugins

All GST Filters specified in the .cheese-effect files are assumed to be installed and working on the system. If external, specific-to-the-effect GST Plugins are needed, it is left to the effect author to provide an installer for them.

Effect Management/Installation

A new tab will be added to the preferences window to manage (install/remove/disable) effects/packs.

Crashing

Before activating an effect, it is tested - to ensure it doesn't crash immedieatly (bugs), or have something stupid (like a sink in the middle of the pipeline description). If it doesn't work as expected, it is disabled (grayed out), with help on why it was disabled.

Timeline

Following is a breakup of the project goals. Estimated time for each target is in braces.

  • Upto May 24: Write up demo applications using libclutter. Gain more indepth knowledge of the GStreamer Pipeline. Do UI mockups.
  • Target 1 (2 weeks): Rewrite UI Chrome (Thumb Display, Menus, Preferences Window) with Vala.
  • Target 2 (2 weeks): Replace the GTK based Video Viewfinder with a Clutter Actor.
  • Target 3 (2 weeks): Implement Live Preview.
  • Code Cleanup Week (1 week): Clean up code wherever needed. Write documentation.
  • Target 4 (1 week): Implement Pluggable Effects.
  • Target 5 (1 week): Write a few effects plugins. Write documentation and samples for writing Effects Plugins.
  • Target 6 (1 week): Implement UI for Effect/Pack Management.
  • Code Cleanup Weeks (2 week): Fix the mess of the last 10 weeks.

Showable at Mid Term

A mostly Vala code base with a working clutter-gst based Live Preview would be the mid-term goal.

About Me

My Name is Yuvaraj Pandian, and I'm currently studying for a B.E in Computer Science at KCG College of Technology, at Chennai, India.

I've been programming in Python for the past two years, and in C#/.NET for two years before that. I have a working knowledge of C, and have contributed to a few patches in GNOME so far. I have around 9 years of programming experience, starting with Turbo C, moving to VB6, then .NET and Python, flirting with numerous languages on the way. I use git for version control and host all my projects at GitHub. I also love photography and spend quite a bit of time editing photos for friends. I helped organize Proto.in and BarcampChennai.

Code Portfolio

I built and maintain Busroutes.in, a local Bus Route search engine for my city. I blog at http://yuvi.in/blog, with a custom built Blogging Engine. I also have several one off code projects, all put up on my GitHub Page.

I've contributed three patches (#592081, #597226 and #615002) to Cheese so far, and helped write one for gnome-games at the HackFest at IIT Madras.

Contact

Name: Yuvaraj Pandian T Mail: me@yuvi.in IRC: yuvipanda on freenode and irc.gnome.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment