Cheese GSoC Report – Week 8

This week on Cheese….

WE MADE A RELEASE! :)

http://ftp.gnome.org/pub/GNOME/sources/cheese/2.31/

Cheese 2.31.1 is out. It’s a dev release. Does not have zarro boogs.

But it is a release!

This week, we

  1. Fixed several perf bugs.
  2. Fixed some weird preferences dialog bugs
  3. Filed (and eventually had fixed) a bug in GStreamer.
  4. Fixed a regression
  5. Beautified the UI a bit (text name overlay of effects, etc)
  6. Assorted administrative work to prepare for release (Copyright
updating, merging back into master, etc)

I also passed my mid terms :)

Next week…

  1. Remove dependency on Mx Toolkit (it is not a blessed dependency,
and i’m not using large parts of it anyway)
  1. Performance improvements, especially at startup time. It is taking
_waaay_ too long .
  1. Fix problems in video mode.
  2. Make the TODO list shorter.

Cheese GSoC Report – Week 7

This week on Cheese….

  1. Performance enhancements. Sacrificed some startup time for much improved usage time. Viewing live effects are now a snap. So is selecting an effect. We went in some cases from ~15s to <1s. Thanks to Tester (and other folks) at #gstreamer for helping out :)
  2. Paging of effects. Effects are now in pages of 9 each, instead of a huge scroller area.
  3. Applying effects without stopping the pipeline. Makes things much faster.
  4. Implementing the popup menu for thumbnails.

We’ll be making a release anytime now :)

All of last week’s goals were met, except the code cleanup. It will probably have to wait after release.

As I type this, there are 6 blockers before we can make a release. Will make a post when we do a release, hopefully with a screencast too!

Next week is kinda unpredictable – I’ll douse fires as they arise in the code (reported by people who hopefully test the release), and also work on reducing the length of items in the TODO.

Cheese GSoC Report – Week 5

Late report. But I did get quite a bit done!

Last week…

  1. Video Effects file format reader
  2. Live Preview of Effects! (YAY!)
  3. Effect files added

Live Preview took most of my time. We bought down CPU usage from ~90% to a more manageable ~50%. Cleaned up code a bit (still needs more cleanup). It is rather very ‘demoable’, provided you gloss over the slowdowns.

Coming up next week would be…

  1. Even less CPU Usage! We’re now even with current Cheese (which does not give you live previews). I want to bring this down even more.
  2. Reduced latency for switching operations. Moving between effects/screens now has more than a second of latency. I should reduce this to much lesser than a second.
  3. Code cleanup. Some of the C code is a mess – needs to be cleaned up much.
  4. Error fixing. You can now crash it by looking at it at a 58 degree angle, during new moon days. Bugs like these will be fixed.

Cya in a week, with a very-usable Cheese! I’ll post a screencast as soon as I’ve made Cheese a bit more sexy :)

Cheese GSoC Report – Week 4

Fourth week of the Summer of Code was over a few days back, and this report is overdue :( I’ve not been able to code as much as I wanted to this week – due to various non-technical issues. Will compensate in the next week.

Last week…

  1. Countdown Animations (Thanks to _ke for cleanup!)
  2. GConf Cleanup

Yes, that was it.

Totally failed to meet last week’s goals. Sigh.

By next week, I hope to have accomplished…

  1. Video Effects file format reader
  2. Basic Effects application to the currently playing pipeline.
  3. Mockups on best weay to present effects UI to user

Here is to hoping the coming week turns out better than last one :)

Cheese GSoC Report – Week 3

Third week of the Summer of Code is over! And during this week….

  1. Successfully wrapped up the core cheese functionality (libcheese) with a vala wrapper
  2. Made Photo Mode work
  3. Made Video Mode work
  4. Made Burst Mode work
  5. Made cheese single instance using libunique
  6. Started work on cleaning up GConf code.

In last week’s report, I mentioned that I didn’t quite like my pace of work. It is still the same (approx. 3 hours a day on average, excluding overhead) – but I’ve come to accept that it is okay. No more bitching about it, as long as I’m meeting my goals.

Last week’s predictions were to complete libcheese wrapping, photo mode, video mode and burst mode. Set goals accomplished with ample time to spare – time that was spent trying to get countdown animations to work (still haven’t managed), and make cheese single instance. I under-estimated last week – should improve accuracy.

By next week, I hope to have accomplished…

  1. Fully functional preferences dialog box
  2. Countdown animations
  3. Full GConf integration (i.e. remember all your preferences)
  4. Full blown keybindings (Basically <Esc> to cancel, since the others are already implemented)
  5. Trash/Delete implementation

It would have everything Cheese 2.30.1 has, except for Effects.

And what did I learn this week?

  1. RTFM. Again. And again. THEN ask on IRC.
  2. How to use gdb. I’ve only cursorily used it before – but digging into it deeper now (thank you, segfault!)

Cheese GSoC Report – Week 2

Second week of the (rather hot and sweaty) Summer of Code is over! And during this week….

  1. Replicated most of the UI of Cheese
  2. Learnt how to make C and Vala code co-exist (Thanks folks at #vala!)
  3. Made the thumbnail widget work, in both modes/orientations
  4. Implemented fullscreen mode, with autohiding of the action buttons
  5. Started modifying parts of libcheese to support clutter for video output

In last week’s report, I mentioned that I didn’t quite like my pace of work. I still don’t like it – Hamster reports I’ve spent 15.2 hours since Monday on Cheese, which is just about 3 hours a day! Totally unacceptable, and I’d like to increase that number considerably.

Last week’s predictions were for libcheese integration, UI replication and Thumbnail view implementation. I’ve finished the last two, and have made a start on the first. Needs improvement.

By next week, I hope to have accomplished…

  1. Working video preview showing up!
  2. Photo taking works
  3. Video taking works
  4. Burst mode works

Basically, it would be usable. In a basic way.

And what did I learn this week?

  1. Don’t try to be too clever. Clear Code > Lesser LoC.
  2. Ask first. Verify assumptions.
  3. Just because something can be rewritten, does not mean it should be :)

On an unrelated note, my sleep cycle is totally messed up – I’ve been sleeping at 6 AM and waking up at 2 PM. Sunlight feels weird to me. I haven’t been able to do my biweekly bicycle rides :( I should also try to fix that before the end of next week.

Cheese GSoC Report – Week 1

First week of official coding is over. What do I have to show for it?

  1. Moved code from Github to GNOME Git (Thanks fargiolas!)
  2. Learnt how to use GTKBuilder, and how to autoconnect signals to vala callback functions.
  3. Learnt some of the intricacies of Gtk+ Layouts (They still have a lot to teach me!)
  4. Got a very basic version of the basic Cheese window up and running.
  5. Learnt how to embed Clutter into the Gtk+ base of Cheese.

So far so good. I don’t quite like the pace of my work – I should be going faster. Hopefully I won’t be feeling like this at the end of next week :)

By next week, I hope to have accomplished…

  1. Pixel perfect UI, replicating exactly what is in cheese right now (except for the viewport, ofcourse)
  2. Vala bindings (.vapi files, basically) for libcheese
  3. Thumbnail View finished (either wrap and use current code, steal some some other project or write my own)
  4. Basic work on modifying libcheese to support video output to a ClutterTexture

GSoC is primarily about learning, so what have I learnt so far?

  1. git is a powerful tool, provided you do not fight it (thanks fargiolas!)
  2. Just because code works, doesn’t mean it is good enough! (thanks _ke!)
  3. When you are stuck, STOP AND ASK FOR DIRECTIONS! (thanks fargiolas!)

Vala, GTKBuilder and Autoconnecting Signal Handlers

Note: I’m not an expert on Vala, GTK+, or anything else for that matter. If I am off base someplace, comment.

I spent quite a some time today trying to get GTKBuilder to automagically connect all my signals to their handlers. I tripped up at a few places, and so recording them here for posterity.

  1. If you are using instance methods (like most of us are), you’ve to decorate your handler function with the attribute [CCode (instance_pos=-1)]. This makes sure that the function is passed the this pointer as last argument, rather than first. You’ve to do this because Builder.connect_signals passes the instance as last parameter (user_data), and by aligning your this pointer with user_data, you make sure the correct instance is called.

  2. Make sure your handler function signature matches what is expected. Ignore the user_data parameter of most signals – it is used internally by Builder.connect_signals (see above point).

  3. Make sure you pass --pkg gmodule-2.0 to your valac. If you’re using Autotools, this means you pass it to VALAFLAGS.

  4. sure your C compiler is called with -dynamic-export. I’m told this enabled support for dlopen in the binary produced.

  5. Mangle your names properly. Cheese.MainWindow.on_quit() becomes cheese_main_window_on_quit on C, and that is what GTKBuilder expects. If you are not sure how your function name is mangled by valac, checkout the generated .c file.

If you do all these 5 things right and you’re still having trouble, turn up on #vala at irc.gimp.net and ask the helpful folks there :)

GSoC Milestones – Vala Build using AutoTools

I’m using a RTM List to track my milestones for this my GSoC this year. I’ll be making a blog post for each item ticked off that list, to share what I’ve learnt in my journey from n00b to someone whose code is good enough to be included in GNOME. This is part 1 in the series, where I tell you about autotools

My GSoC project involves, moving major parts (UI) of Cheese to a new language – Vala. Vala is more an extremely glorious C preprocessor than a language of its own – it just translates down to GObject based C code, rather than bytecode/objectcode. The syntax is very C#ish – I was using csharp-mode in emacs to code vala till I got bored enough to download vala-mode. It’s got closures – haven’t used them yet, here is to hoping they’re real closures. It has tons of libraries – it takes a few (minutes|hours) to write a binding for any C library, so many bindings already exist. You don’t lose speed – Vala is compiled down to C code. It also has one of Java’s suckiest features – Checked Exceptions. The documentation is non existent – you’ve to pretty much read through the bindings, or the original C library’s documentation to get anything done. And not many people know such a language exists (Kausik for example – but he also didn’t know you could output pdf from latex, so I don’t think his opinion counts :D)

Cheese uses autotools for building. I had to tweak their script to make it build my Vala code as well. I’ve never worked with any of the autotools stuff before – I didn’t even know .ac stood for autoconf and .am stood for automake. No big deal – Google knows it all and will tell you for free. I JFGI and found a bunch of articles about using autotools to successfully build vala projects. After reading this monstrous (180+ slides, but ~500 pages) Autotools presentation (which is actually very, very good, btw), I had a working build script. It built my single cheese.vala file that did nothing but run a loop and wait to be terminated. It had a place where I could add more .vala files and they should (should) be included in the build. It was hackish, but like most hacks, it worked. On My Machine(tm).

Nowhere else. Turned out my script wasn’t working at all – just faking it to me. I had initially tested out valac (the vala compiler), which had produced a .c file. Since make was supposed to produce the same file, and it wasn’t stale (I hadn’t touched my cheese.vala), it just proceeded to compiling the .c files with gcc. The Vala part of the build script wasn’t being executed at all. Removing the .c file told me that my hackish script hadn’t worked at all.

After banging my head for a while to figure out why it wasn’t working, I finally landed up on the official autotools docs. Autotools had added native vala support. The hack I found was not necessary.

facepalm

Moral of the Story: RTFM comes first, not JFGI.

Anyway, I rewrote the build script to be much more cleaner in a couple of minutes. And it worked.

Build systems are actually a lot of fun once you get the hang of it. A black screen with fast scrolling green text cryptic to everyone else but totally sensible to you is incredibly attractive, no? :)