SoC Report: week 2

Hey all! As you might have noticed I’m not too much into blogging, my last post is more than 2 weeks old..
Anyway, I’m supposed to post a weekly status report to the gnome-soc list, so why not to take it as a chance to keep you all updated about my work? So, expect at least a post per week from now on, around each monday 😉

Brief summary of first week

I didn’t code too much the first week since I’ve been very busy with last lessons at the university.
Besides it’s not that I didn’t do anything, I managed to start some basic work with gstreamer gl plugin. I began to extend the gstreamer gl library with some GLSL shader support, basically I’ve written a couple of GObject classes to abstract from gl primitives and use them easily.
I’ve also written a little gtk test app that shows video images with xvimagesink and xoverlay and select effects with a combo button. Nothing too complicated but more than enough for what I need at the moment.

2nd Week Report

Within last week I kept on working on gstreamer gl library, I’ve finished and committed the first draft of a shader abstraction library, it’s capable of creating program and shader objects with usual gobject methods, compile shaders, attach them to a program, link and attach them to GL pipeline.
At the moment, so, it simply wraps the correspondent gl methods, take care of error handling, and clean up everything when program or shader ref count reaches 0.
The gobject abstraction, though, will simplify, for example adding support for ARB programs (asm shaders) and use them with the same api of GLSL ones.
It would also allow to have convenience methods like gst_gl_shader_add (not yet implemented) to have a shader compiled, attached and linked with just one call, or to keep track of multiple shaders attached to the same program object so that it would be easy to release them all at once. Furthermore the use of gobject makes code clean, and easier to read and debug.
There are still a couple of things I’m not quite sure about:

  • How to handle errors?
  • GLSL shaders are designed to resemble C programs, hence they have to be compiled and linked before attaching them to the GL state. This process could rise errors, warnings and info messages that can be queried and are extremely useful for debugging. How should my library handle them? At the moment I’m setting a GError with compilation and linking messages and leaving to the user (the GstGLFilter element) the task to handle them. Should I use g_error, g_warning and g_message instead? Or should I use GstInfo debug macros directly from the shader objects?

  • Ehm.. I forgot the others while writing about the previous 🙂

I’ve also started to write the real GstElement that all my summer project is about, GstGLEffects (the name is not definitive).
It’s a subclass of GstGLFilter written taking David’s GstGLFilterExample as a model. I didn’t commit this yet, but it’s already capable of using the new shader abstraction library and can be used as a starting point to develop the effects.
It maps video texture to a GL quad (at the moment switched right to left to resemble looking at a mirror when used with webcam stream, but I plan to set this with a property sooner or later).
Effects are being selected with a enum property that sets an effect_changed attribute and binds an effect function pointer to the right effect. This is needed because gl functions have to be called within the basetransform filter methods where we can be sure there is a valid gl context and display is locked. This has a positive side effect to allow to set effects even when the pipeline is paused (and of course when is playing). There is also no need to rebuild the pipeline every time like Cheese does at the moment since we just have one element that does all the work.
To concentrate on effects developing at the moment only one effect at the time can be used (since it was simpler to implement) but I plan to add support for multiple effects in the future.
I also began to play a bit with some effect, mainly distortion ones, but they are still at an early stage so stay tuned during next weeks to see more!

I think that’s all for this week, I surely have forgotten something and as always I didn’t manage to be concise 🙁 I promise to post more often so each post will be shorter next times 😉

1 comment so far ↓

#1 Isa on 06.20.08 at 7:30 pm

ciao amore!sei il migliore! continua così! 😉

Leave a Comment