Sunday, December 30, 2007

Dot graph from GStreamer pipeline

For creating a dot graph from a GStreamer pipeline set the environment variable GST_DEBUG_DUMP_DOT_DIR ( NOT GST_DEBUG_DUMP_DOT_FILES) to a correct output folder.

Start a pipeline:
gst-launch playbin uri=file:///home/thijs/Desktop/mewmew-vorbis-ssa.mkv

On warnings and error's this pipeline will create a dot file. A error can be generated by killing the output window. Now you can transform this dot file to a svg/png/... file. I prefer the use of svg files because the png file from this pipeline is more than 38000 pixels width and crashes my image viewer.
dot -Tsvg -o pipeline.svg

Now you can view your pipeline in inkscape.

Thursday, August 16, 2007

Hildon banner in pymaemo

In my journey of exploring python for the N800 I spotted some problems with using the hildon banner with the pymaemo bindings.
Now these problems are fixed in the svn version (thanks to Lauro Moura). I made a little example file based on the C api how to use this hildon banner in pymaemo.

import gtk
import hildon

class hildonBannerWindow(hildon.Window):
def __init__(self):
self.button = gtk.Button('Show Info');
self.button.connect('clicked', self.show_banner_cb)
self.connect('destroy', gtk.main_quit)
self.banner_type = 1
self.banner = None

def show_banner_cb(self, widget):
if self.banner_type == 1:
hildon.hildon_banner_show_information(self, None, "Hello Information")
elif self.banner_type == 2:
self.banner = hildon.hildon_banner_show_animation(self, None, "Hello Animation")
elif self.banner_type == 3:
elif self.banner_type == 4:
self.banner = hildon.hildon_banner_show_progress(self, None, "Info with progress bar")
elif self.banner_type == 5:
elif self.banner_type == 6:
self.banner_type = 0
self.banner_type += 1

if __name__ == '__main__':
window = hildonBannerWindow()

I shows there are 3 types of hildon banners:

hildon information : Just an information icon that shows up for a few seconds

hildon animation : Shows an spinning wheel whith some text ,this was the one I needed ;)

hildon progress : Can show a progressbar with some text next to it.

The two last one needs to be destroyed after using them.