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.
export GST_DEBUG_DUMP_DOT_DIR=/tmp

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 0:00:02.270914892-gst-launch.error.dot

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):
hildon.Window.__init__(self)
self.button = gtk.Button('Show Info');
self.button.connect('clicked', self.show_banner_cb)
self.connect('destroy', gtk.main_quit)
self.add(self.button)
self.show_all()
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:
self.banner.destroy()
elif self.banner_type == 4:
self.banner = hildon.hildon_banner_show_progress(self, None, "Info with progress bar")
self.banner.set_fraction(0.2)
elif self.banner_type == 5:
self.banner.set_fraction(0.8)
elif self.banner_type == 6:
self.banner.destroy()
self.banner_type = 0
self.banner_type += 1

if __name__ == '__main__':
window = hildonBannerWindow()
gtk.main()


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.