<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.6(BH)" -->
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Planet Maemo: category &quot;feed:70bebeb934a26428d85371654b6c3163&quot;</title>
        <description>Blog entries from Maemo community</description>
        <link>http://maemo.org/news/planet-maemo/</link>
        <lastBuildDate>Sun, 24 May 2026 11:16:35 +0000</lastBuildDate>
        <generator>FeedCreator 1.7.6(BH)</generator>
        <language>en</language>
        <managingEditor>planet@maemo.org</managingEditor>
        <item>
            <title>GUADEC 2012: state of calvaris</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/08/06/guadec-2012-state-of-calvaris/</link>
            <description><![CDATA[
<p align="center"><img src="http://guadec.org/sites/www.guadec.org/files/banner-125.png" alt="GUADEC 2012 A Coruña" /></p>
<h3>Executive summary</h3>
<p>Tired as hell but with my hacking batteries completelly full.</p>
<h3>Organization</h3>
<p>There was always something to do here and there, which I needed to help with, but I think the most important things that I did were:</p>
<ul>
<li>Organizing the Lightning Talks session, I guess you all remember the sound of the sea and the seaguls that I choose to indicate people that they were running out of time.</li>
<li>I helped Marina and Christophe in organizing the Interns&#8217; Lightning Talks, which you can also guess because Marina liked the sea sound and decided to use it also for their session.</li>
<li>I helped Juanjo in organizing the BoFs. He planned them and I managed them at the indico.</li>
<li>Random stuff</li>
<li>Keeping hackers happy. Having <a href="http://zee-nix.blogspot.com.es/">Zeenix</a> at my place implied hanging out almost every day with the hackers for dinner and beers so I needed to do my best to have them properly fed and with the deserved &#8216;party level&#8217;. I took some people to do some sightseeing and to several restaurants like A Roda, O Galiñeiro&#8230; I even remember going to a place with live music at Os Maios close to a Pulpeira de Arzúa.</p>
</ul>
<p>The only bad thing I can think of is that I missed some talks because of having a lot of things to do.</p>
<h3>Interesting talks</h3>
<p>I attended all the talks I could and just tried to avoid the ones by <a href="http://www.igalia.com">Igalians</a> because for obvious reasons I already knew what they were about, so I&#8217;ll mention the ones that I liked most:</p>
<ul>
<li>Jacob Appelbaum&#8217;s keynote: Personal data exposure is underestimated by most people but it is something very important that we should care about. It would be interesting to have Tor integrated with GNOME.</li>
<li>Every detail matters by Allan: Suddenly you realize that you are in a better mood when using your GNOME 3 and the reason is because there are some guys focusing on having the small bugs fixed that were annoying you without noticing.</li>
<li>MinGW-w64 by Marc-André: Quite interesting talk about tools and recipes to crosscompile your programs for the Evil. This is quite important to help us with the task of showing that the GNOME world is as multiplatform as other options (you would be a fool if you think that you can have everything working like a charm on the Evil when using some frameworks that claim to be multiplatform just out of the box).</li>
<li>i18n by Gil: Random though: No native English speaker developer was on that talk. We really need to improve this. Then we can talk about tools and other stuff. Though I did not attend the BoF, I talked to <a href="http://l10n.gnome.org/users/frandieguez/">Fran Diéguez</a> and my wife <a href="https://sites.google.com/a/madsgroup.org/laura-castro/">Laura</a> about some stuff the students of the <a href="http://www.udc.es/index.html?language=en">Universidade da Coruña</a> could help with to improve translators&#8217; lives, maybe combined with <a href="https://live.gnome.org/SummerOfCode2012/">GSoC</a> or <a href="https://live.gnome.org/GnomeWomen/OutreachProgram2012">OPW</a>.</li>
<li><a href="http://gstreamer.freedesktop.org/">GStreamer</a> talk by Tim Müller: Can&#8217;t ever miss it. 1.0 is almost there and it shines!</li>
<li><a href="http://www.pitivi.org/">PiTiVi</a> by Jeff: Constant lol. Cannot wait to see the videos uploaded. Really enjoyed it not only because of it being fun, but because of all the new features coming to our favorite video editor.</li>
<li>Defensive publications: Patents suck in all senses and even more at FLOSS. These guys should be keynoters at all FLOSS events all over the world, because something I learned lately is that people can do things when they unite. If we help with bringing things to the public knowledge before they are patented by others (because Patent Offices workers are far from perfection considering their model that I do not agree with) we can do something. I recommend you to have a look at the <a href="http://www.openinventionnetwork.com">Open Innovation Network</a>.</li>
<li>History of GNOME: it is always interesting to look back to see how much we have walked.</li>
</ul>
<h3>Fixed bugs</h3>
<ul>
<li>After speaking to Matthias Clasen, I got the permission to apply the patches I had submitted for <a href="https://bugzilla.gnome.org/show_bug.cgi?id=613595">GB#613595</a>. This was quite an old bug that I had worked on from the times of <a href="https://garage.maemo.org/projects/hildon">Hildon</a> in Fremantle. Just after pushing I realized that I had caused a small regression but fortunately I fixed it before having consequences.</li>
<li><a href="http://www.hadess.net/">Bastien</a> closed <a href="https://bugs.freedesktop.org/show_bug.cgi?id=49945">FDB#49945</a> about <a href="http://www.freedesktop.org/wiki/Software/GeoClue">GeoClue</a> by pushing my patch.</li>
<li><a href="http://blogs.gnome.org/edwardrv/">Edward</a> promised to have a look at the patches I submitted for <a href="https://bugzilla.gnome.org/show_bug.cgi?id=663869">GB#663869</a>. This is not closed yet, but I hope he does not forget <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f609.png" alt="<span class="net_nemein_favourites">4 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=38f6df8edfe511e1b37451d27c4e223d223d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/38f6df8edfe511e1b37451d27c4e223d223d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=38f6df8edfe511e1b37451d27c4e223d223d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/38f6df8edfe511e1b37451d27c4e223d223d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Mon, 06 Aug 2012 15:43:53 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-38f6df8edfe511e1b37451d27c4e223d223d</guid>
        </item>
        <item>
            <title>GUADEC 2012</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/07/19/guadec-2012/</link>
            <description><![CDATA[
<p>Wow, something I think I would not see, but GUADEC is happening less than 3km from home in less than a week!</p>
<p align="center"><img src="http://guadec.org/sites/www.guadec.org/files/banner-125.png" alt="GUADEC 2012 A Coruña" /></p>
<p>I have collaborated in organizing the Lightning Talks and BoFs/Hackfests and of course, I&#8217;ll help wherever I can. Poor <a href="http://zee-nix.blogspot.com.es/">Zeenix</a> will be at my place so he will need to wake up early to come with me and my wife <a href="https://sites.google.com/a/madsgroup.org/laura-castro/">Laura</a> to the <a href="https://maps.google.es/maps?q=Facultade+de+Inform%C3%A1tica,+Estrada+de+Castro+de+Elvi%C3%B1a,+A+Coru%C3%B1a&amp;hl=gl&amp;ie=UTF8&amp;sll=43.352195,-8.405639&amp;sspn=0.101481,0.219898&amp;oq=facultade+de+inf&amp;t=h&amp;hq=Facultade+de+Inform%C3%A1tica,&amp;hnear=Estrada+de+Castro+de+Elvi%C3%B1a,+15008+A+Coru%C3%B1a,+Galicia&amp;z=17">faculty</a>.</p>
<p>I also want to thank <a href="http://www.igalia.com">Igalia</a> for sponsoring me with time to help organizing and attending the event and I might be also helping the Advisory Board meeting that will happen at Igalia headquarters on the 25th.</a></p>
<span class="net_nemein_favourites">7 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=7fa030b4d1af11e1ab51e161c6a3b266b266&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/7fa030b4d1af11e1ab51e161c6a3b266b266/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=7fa030b4d1af11e1ab51e161c6a3b266b266&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/7fa030b4d1af11e1ab51e161c6a3b266b266/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Thu, 19 Jul 2012 14:22:45 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-7fa030b4d1af11e1ab51e161c6a3b266b266</guid>
        </item>
        <item>
            <title>Aura made me Qt Ambassador</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/05/16/aura-made-me-qt-ambassador/</link>
            <description><![CDATA[
<p>As I already said the other day in <a href="https://twitter.com/#!/calvaris/status/200983547262144512">Twitter</a>, I became <a href="http://qt.nokia.com/qt-in-use/ambassadors/project?id=a0F2000000Fui0EEAR">Qt Ambassador</a> because of <a href="http://www.igalia.com/nc/work/labs/project/item/aura/">Aura</a>. The only problem is that is a project-person program, meaning that it is granted to a person because of having worked on a project. <a href="http://igalia.github.com/aura/">Aura</a> was a project developed by three <a href="http://www.igalia.com/">Igalians</a>, who were <a href="http://www.igalia.com/nc/igalia-247/igalian/item/magomez/">Miguel</a>, <a href="http://www.igalia.com/nc/igalia-247/igalian/item/vjaquez/">Víctor</a> and <a href="http://www.igalia.com/nc/igalia-247/igalian/item/calvaris/">me</a> and I consider a bit unfair that it was granted only to me because they deserve it as much as I do.</p>
<p>The procedure I followed was:</p>
<ul>
<li>Applying with Aura</li>
<li>When that was accepted, I submitted Aura project page.</li>
<li>After the publication I was told that I was going to receive the <a href="http://qt.nokia.com/qt-in-use/ambassadors/qtambassador#qt-ambassador-benefits">Qt Ambassador Merchansise</a></li>
</ul>
<p>Does anybody know if more people can become ambassadors for the same project and how?</p>
<span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=e46c74ea9f6d11e1a12f11584ede24532453&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/e46c74ea9f6d11e1a12f11584ede24532453/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=e46c74ea9f6d11e1a12f11584ede24532453&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/e46c74ea9f6d11e1a12f11584ede24532453/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Wed, 16 May 2012 15:32:04 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-e46c74ea9f6d11e1a12f11584ede24532453</guid>
        </item>
        <item>
            <title>Sending emails in Harmattan with Qt/QML</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/05/11/sending-emails-in-harmattan-with-qtqml/</link>
            <description><![CDATA[
<p>In the context of a personal ad-hoc app (I will come to that later) that I wrote for my <a href="http://en.wikipedia.org/wiki/Nokia_N9">Nokia N9</a>, I needed to send an email to a specific person with an attachment. After the first research at <a href="http://harmattan-dev.nokia.com/docs/library/html/guide/html/Developer_Library_MeeGo_1.2_Harmattan_Developer_Library.html">Harmattan APIs</a> you come to <a href="http://harmattan-dev.nokia.com/docs/library/html/qtmobility/qmessageservice.html?tab=3&amp;q=QMessageService">QMessageService</a>.</p>
<p>The first thing I did was writing <a href="http://blogs.igalia.com/xrcalvar/2012/03/19/mixed-qmlc-objects-reloaded/">Mixed QML/Qt</a> object that I could instantiate from the <a href="http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeintroduction.html">QML</a> code so that I could do something like:</p>
<pre>
Message {
    id: message
    from: "my@Address"
    to: [ "destination@Address" ]
    subject: "This is not Spam for sure!"
    body: "Trolled! Enlarge...!"
    attachments: [ "/a/path/to/an/attachment" ]
}

Button {
    onClicked: message.compose()
//    onClicked: message.send()
}
</pre>
<p></p>
<p>There we have an object with two <code>send</code> and <code>compose</code> methods, three string properties representing the from, subject and body and two string list properties representing the to and attachments (we leave the CC and BCC as an exercise <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f609.png" alt="<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=298b21029b5e11e1a52dc7ab98aca606a606&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/298b21029b5e11e1a52dc7ab98aca606a606/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=298b21029b5e11e1a52dc7ab98aca606a606&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/298b21029b5e11e1a52dc7ab98aca606a606/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Fri, 11 May 2012 10:46:03 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-298b21029b5e11e1a52dc7ab98aca606a606</guid>
        </item>
        <item>
            <title>Painting video with GStreamer and Qt/QML or Gtk+ with overlay</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/04/29/painting-video-with-gstreamer-and-qtqml-or-gtk-with-overlay/</link>
            <description><![CDATA[
<p>As part of my work at <a href="http://www.igalia.com">Igalia</a> I had to work with video and <a href="http://gstreamer.freedesktop.org/">GStreamer</a> for some years. I always used <a href="http://www.gtk.org/">Gtk+</a> for that so when I needed to do things with <a href="http://qt.nokia.com/">Qt</a> and <a href="http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeintroduction.html">QML</a>, things were different. In my projects I always used pure GStreamer code instead of the Qt bindings for GStreamer because at the moment those bindings were not ready or reliable.</p>
<p>I know two ways of painting video:</p>
<ul>
<li>Overlay way, with a window id and so on</li>
<li>Texture streaming</li>
</ul>
<p>I might write later about texture streaming, but I will focus now on overlay.</p>
<h3>Painting</h3>
<p></p>
<p>The first way means that you need from your graphical toolkit a window id. That window id is asked by the video sink element in a very special moment and you need to provide it in that moment if you have not provided it before. For example, if you are using <em>playbin2</em> and you already know the sink you want to use, just instantiate your sink and set the window id at that moment with <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html#gst-x-overlay-set-window-handle">gst_x_overlay_set_window_handle</a> and set the sink to the playbin2 element by setting the <code>video-sink</code> property.</p>
<p>If you are not using playbin2 and for example you are using <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-editing-services/html/ch01.html">GStreamer Editing Services</a>, you cannot use a property because currently there is no one and need to use a more complicated method. I already reported the <a href="https://bugzilla.gnome.org/show_bug.cgi?id=663869">bug with its patches</a> and hope that they apply them as soon as possible to improve compatibility with playbin2 because the way it is now is a bit inconsistent with the rest of GStreamer code base.</p>
<p>Both Qt and Gtk have now client side windows, which means that your program window has only one X window and it is the toolkit that decides which widget is receiving the events. The main consequence is that if we just set the window id, GStreamer will use the whole window and will paint the video over the rest of our widgets (it does not matter if QML/Qt or Gtk+) and you&#8217;ll get very ugly effects. To solve that, you need to set the <em>render rectangle</em>, which are the coordinates (relative to the X whole X window) where you want to paint your video. You need to do that just after setting the window id with <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html#gst-x-overlay-set-render-rectangle">gst_x_overlay_set_render_rectangle</a>.</p>
<p>If you do not set your window handle and your render rectangle before the pipeline begins to move, it will ask you about that with the <code>prepare-xwindow-id</code> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html">GstMessage</a>, but this message can happen inside the GStreamer threads and it cannot wait until the main loop runs, it needs the information at that very moment, so you need to connect to the synchronous bus handle. GStreamer has a good example at the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html">GstXOverlay</a> documentation about how to do that. To use the callback in C++, you need to declare a static method and pass <code>this</code> as user data parameter, then you can behave almost as having a normal object method. This is the most common solution used in the GNOME world and fits perfectly with the Qt framework too.</p>
<p>The code to get the window id and render rectangle in Gtk+ would be something like:</p>
<pre>
GdkWindow *gdk_window;
gdk_window = gtk_widget_get_window(your_widget);
/* as sink you can use GST_MESSAGE_SRC() if you are waiting
    for the prepare-xwindow-id message */
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(your_sink),
                             GDK_WINDOW_XID(gdk_window));
/* do your maths about your coordinates */
gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink),
                                x, y, width, height);
</pre>
<p></p>
<p>In Qt, if you are using common widgets, you could use something like:</p>
<pre>
WId winId = QApplication::activeWindow()-&gt;effectiveWinId();
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(your_sink),
                             winId);
/* do your maths about your coordinates */
gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink),
                                x, y, width, height);
</pre>
<p></p>
<p>If you are using a <code>QGraphicsScene</code> you would do something like:</p>
<pre>
/* to get the view you could do something like this
    (if you have only one or will to mess things up):
QGraphicsView *view = your_scene.views[0];
*/
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(your_sink),
                             view-&gt;viewport()-&gt;effectiveWinId());
/* do your maths about your coordinates */
gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink),
                                x, y, width, height);
</pre>
<p></p>
<p>If you are using QML, you would have a very similar approach to the last snippet, because as you should have a <code>QDeclarativeItem</code>, it has a <code>scene()</code> that you can use, to have something like <code>QGraphicsView *view = scene().views[0];</code> (of course, assuming that you have only one view, which is the most common case).</p>
<h3>Overlaying stuff</h3>
<p></p>
<p>Some times it is nice do put your controls on top of the video by covering part of the image. It would be like having the video as the background of a canvas where you draw some other widgets. Some GStreamer elements give you the possibility of doing a trick to do this, which is using a colorkey for your background and painting whatever you want on top of that as long as it does not include that colorkey. Some elements like <em>xvimagesink</em> or <em>omapxvsink</em> (used in the <a href="http://en.wikipedia.org/wiki/Nokia_N9">Nokia N9</a> and <a href="http://en.wikipedia.org/wiki/Nokia_N950">N950</a>) have the <code>colorkey</code> property that you can read and set. If you are not planning to overlay anything, you can forget about this, but if you do, you need set a color key to the sink and use that color to paint the background of your widget and a good moment is also when setting the window handle:</p>
<pre>
g_object_set(sink, "autopaint-colorkey", FALSE,
             "colorkey", 0x080810, NULL);
</pre>
<p></p>
<p>Why do I unset the colorkey autopainting? Because I do not want GStreamer to mess my widget painting.</p>
<p>And more important: Why did I use <code>0x080810</code>? Because it is a dark color, close to black, but it is not black. Pure black can be dangerous as it is commonly used in themes when painting widgets so you would be getting ugly artifacts. Some people recommend magenta (<code>0xFF00FF</code>) as it is supposedly a color that does not exist in nature (citation needed). I would not do it for several reasons:</p>
<ul>
<li> You will need to synchronize your painting very well to avoid seeing the colorkey</li>
<li>If you respect aspect ratio you will see it for sure, because you (or the sink if it is automatic) paint the backgound and the sink draws the image by leaving some empty space.</li>
<li>It does not behave well with blendings, as you blend from your widget color to the background, which is the colorkey</li>
</ul>
<p>Advice: do not mess with colorkey and <code>omapxvsink</code>. Though it is supposed to be writable, it is not and it always uses <code>0x080810</code>.</p>
<h3>Aspect ratio</h3>
<p></p>
<p>There are two kind of people:</p>
<ul>
<li>The ones that want to use all the pixels of their monitor/TVs and like damaging their brain with distorted images.</li>
<li>The ones that like to see a correctly dimensioned image with some bars giving you a better impression of what was recorded.</li>
</ul>
<p>As you can guess I belong to the second group.</p>
<p>There are some sinks that do that automatically for you by setting the <code>force-aspect-ratio</code> property, like <em>ximagesink</em> and <em>xvimagesink</em> but there are other that does not and <em>omapxvsink</em> is an example. It is not a big problem but forces you to work a bit more when you select the <em>render rectangle</em>. For that you need to know the video size, which you cannot know until the pipeline is running, which forces to to hook to the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html#GstMessageType">GST_MESSAGE_ASYNC_DONE</a>, or in the case of <em>playbin2</em>, you already have the video size when getting the <code>prepare-xwindow-id</code> message. An example to get the video size would be:</p>
<pre>
GstPad *pad;
GstCaps *caps;
GstStructure *structure;
int width, height;

pad = GST_BASE_SINK_PAD(sink);
caps = GST_PAD_CAPS(pad);
g_return_if_fail(caps &amp;&amp; gst_caps_is_fixed(caps));

structure = gst_caps_get_structure(caps, 0);
gst_structure_get_int(structure, "width", &amp;width);
gst_structure_get_int(structure, "height", &amp;height);

/* some videos define a pixel aspect ratio, meaning that the
   video pixel could be like 2x1 copared to a squared pixed
   and we need to correct this */
if (gst_structure_has_field(structure, "pixel-aspect-ratio")) {
    int par_n, par_d;
    gst_structure_get_fraction(structure, "pixel-aspect-ratio",
                               &amp;par_n, &amp;par_d);
    width = width * par_n / par_d;
}

/* trick: some sinks perform better with multiple of 2 */
width &amp;= ~1;
height &amp;= ~1;
</pre>
<p></p>
<span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=40e33b6a919411e1b75cc7b7037b4b004b00&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/40e33b6a919411e1b75cc7b7037b4b004b00/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=40e33b6a919411e1b75cc7b7037b4b004b00&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/40e33b6a919411e1b75cc7b7037b4b004b00/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Sat, 28 Apr 2012 23:58:16 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-40e33b6a919411e1b75cc7b7037b4b004b00</guid>
        </item>
        <item>
            <title>Painting video with QML/Qt or Gtk+ and GStreamer with overlay</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/04/27/painting-video-with-qmlqt-or-gtk-and-gstreamer-with-overlay/</link>
            <description><![CDATA[
<p>As part of my work at <a href="http://www.igalia.com">Igalia</a> I had to work with video and <a href="http://gstreamer.freedesktop.org/">GStreamer</a> for some years. I always used <a href="http://www.gtk.org/">Gtk+</a> for that so when I needed to do things with <a href="http://qt.nokia.com/">Qt</a> and <a href="http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeintroduction.html">QML</a>, things were different. In my projects I always used pure GStreamer code instead of the Qt bindings for GStreamer because at the moment those bindings were not ready or reliable.</p>
<p>I know two ways of painting video:</p>
<ul>
<li>Overlay way, with a window id and so on</li>
<li>Texture streaming</li>
</ul>
<p>I might write later about texture streaming, but I will focus now on overlay.</p>
<h3>Painting</h3>
<p></p>
<p>The first way means that you need from your graphical toolkit a window id. That window id is asked by the video sink element in a very special moment and you need to provide it in that moment if you have not provided it before. For example, if you are using <em>playbin2</em> and you already know the sink you want to use, just instantiate your sink and set the window id at that moment with <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html#gst-x-overlay-set-window-handle">gst_x_overlay_set_window_handle</a> and set the sink to the playbin2 element by setting the <code>video-sink</code> property.</p>
<p>If you are not using playbin2 and for example you are using <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-editing-services/html/ch01.html">GStreamer Editing Services</a>, you cannot use a property because currently there is no one and need to use a more complicated method. I already reported the <a href="https://bugzilla.gnome.org/show_bug.cgi?id=663869">bug with its patches</a> and hope that they apply them as soon as possible to improve compatibility with playbin2 because the way it is now is a bit inconsistent with the rest of GStreamer code base.</p>
<p>Both Qt and Gtk have now client side windows, which means that your program window has only one X window and it is the toolkit that decides which widget is receiving the events. The main consequence is that if we just set the window id, GStreamer will use the whole window and will paint the video over the rest of our widgets (it does not matter if QML/Qt or Gtk+) and you&#8217;ll get very ugly effects. To solve that, you need to set the <em>render rectangle</em>, which are the coordinates (relative to the X whole X window) where you want to paint your video. You need to do that just after setting the window id with <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html#gst-x-overlay-set-render-rectangle">gst_x_overlay_set_render_rectangle</a>.</p>
<p>If you do not set your window handle and your render rectangle before the pipeline begins to move, it will ask you about that with the <code>prepare-xwindow-id</code> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html">GstMessage</a>, but this message can happen inside the GStreamer threads and it cannot wait until the main loop runs, it needs the information at that very moment, so you need to connect to the synchronous bus handle. GStreamer has a good example at the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html">GstXOverlay</a> documentation about how to do that. To use the callback in C++, you need to declare a static method and pass <code>this</code> as user data parameter, then you can behave almost as having a normal object method. This is the most common solution used in the GNOME world and fits perfectly with the Qt framework too.</p>
<p>The code to get the window id and render rectangle in Gtk+ would be something like:</p>
<pre>
GdkWindow *gdk_window;
gdk_window = gtk_widget_get_window(your_widget);
/* as sink you can use GST_MESSAGE_SRC() if you are waiting
    for the prepare-xwindow-id message */
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(your_sink),
                             GDK_WINDOW_XWINDOW(gdk_window));
/* do your maths about your coordinates */
gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink),
                                x, y, width, height);
</pre>
<p></p>
<p>In Qt, if you are using common widgets, you could use something like:</p>
<pre>
WId winId = QApplication::activeWindow()->effectiveWinId();
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(your_sink),
                             winId);
/* do your maths about your coordinates */
gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink),
                                x, y, width, height);
</pre>
<p></p>
<p>If you are using a <code>QGraphicsScene</code> you would do something like:</p>
<pre>
/* to get the view you could do something like this
    (if you have only one or will to mess things up):
QGraphicsView *view = your_scene.views[0];
*/
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(your_sink),
                             view->viewport()->effectiveWinId());
/* do your maths about your coordinates */
gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink),
                                x, y, width, height);
</pre>
<p></p>
<p>If you are using QML, you would have a very similar approach to the last snippet, because as you should have a <code>QDeclarativeItem</code>, it has a <code>scene()</code> that you can use, to have something like <code>QGraphicsView *view = scene().views[0];</code> (of course, assuming that you have only one view, which is the most common case).</p>
<h3>Overlaying stuff</h3>
<p></p>
<p>Some times it is nice do put your controls on top of the video by covering part of the image. It would be like having the video as the background of a canvas where you draw some other widgets. Some GStreamer elements give you the possibility of doing a trick to do this, which is using a colorkey for your background and painting whatever you want on top of that as long as it does not include that colorkey. Some elements like <em>xvimagesink</em> or <em>omapxvsink</em> (used in the <a href="http://en.wikipedia.org/wiki/Nokia_N9">Nokia N9</a> and <a href="http://en.wikipedia.org/wiki/Nokia_N950">N950</a>) have the <code>colorkey</code> property that you can read and set. If you are not planning to overlay anything, you can forget about this, but if you do, you need set a color key to the sink and use that color to paint the background of your widget and a good moment is also when setting the window handle:</p>
<pre>
g_object_set(sink, "autopaint-colorkey", FALSE,
             "colorkey", 0x080810, NULL);
</pre>
<p></p>
<p>Why do I unset the colorkey autopainting? Because I do not want GStreamer to mess my widget painting.</p>
<p>And more important: Why did I use <code>0x080810</code>? Because it is a dark color, close to black, but it is not black. Pure black can be dangerous as it is commonly used in themes when painting widgets so you would be getting ugly artifacts. Some people recommend magenta (<code>0xFF00FF</code>) as it is supposedly a color that does not exist in nature (citation needed). I would not do it for several reasons:</p>
<ul>
<li> You will need to synchronize your painting very well to avoid seeing the colorkey</li>
<li>If you respect aspect ratio you will see it for sure, because you (or the sink if it is automatic) paint the backgound and the sink draws the image by leaving some empty space.</li>
<li>It does not behave well with blendings, as you blend from your widget color to the background, which is the colorkey</li>
</ul>
<p>Advice: do not mess with colorkey and <code>omapxvsink</code>. Though it is supposed to be writable, it is not and it always uses <code>0x080810</code>.</p>
<h3>Aspect ratio</h3>
<p></p>
<p>There are two kind of people:</p>
<ul>
<li>The ones that want to use all the pixels of their monitor/TVs and like damaging their brain with distorted images.</li>
<li>The ones that like to see a correctly dimensioned image with some bars giving you a better impression of what was recorded.</li>
</ul>
<p>As you can guess I belong to the second group.</p>
<p>There are some sinks that do that automatically for you by setting the <code>force-aspect-ratio</code> property, like <em>ximagesink</em> and <em>xvimagesink</em> but there are other that does not and <em>omapxvsink</em> is an example. It is not a big problem but forces you to work a bit more when you select the <em>render rectangle</em>. For that you need to know the video size, which you cannot know until the pipeline is running, which forces to to hook to the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html#GstMessageType">GST_MESSAGE_ASYNC_DONE</a>, or in the case of <em>playbin2</em>, you already have the video size when getting the <code>prepare-xwindow-id</code> message. An example to get the video size would be:</p>
<pre>
GstPad *pad;
GstCaps *caps;
GstStructure *structure;
int width, height;

pad = GST_BASE_SINK_PAD(sink);
caps = GST_PAD_CAPS(pad);
g_return_if_fail(caps &#038;&#038; gst_caps_is_fixed(caps));

structure = gst_caps_get_structure(caps, 0);
gst_structure_get_int(structure, "width", &#038;width);
gst_structure_get_int(structure, "height", &#038;height);

/* some videos define a pixel aspect ratio, meaning that the
   video pixel could be like 2x1 copared to a squared pixed
   and we need to correct this */
if (gst_structure_has_field(structure, "pixel-aspect-ratio")) {
    int par_n, par_d;
    gst_structure_get_fraction(structure, "pixel-aspect-ratio",
                               &#038;par_n, &#038;par_d);
    width = width * par_n / par_d;
}

/* trick: some sinks perform better with multiple of 2 */
width &#038;= ~1;
height &#038;= ~1;
</pre>
<p></p>
<span class="net_nemein_favourites">0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=3599f7fc905f11e19dd54bab16042cd92cd9&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/3599f7fc905f11e19dd54bab16042cd92cd9/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>4 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=3599f7fc905f11e19dd54bab16042cd92cd9&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/3599f7fc905f11e19dd54bab16042cd92cd9/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Fri, 27 Apr 2012 11:26:23 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-3599f7fc905f11e19dd54bab16042cd92cd9</guid>
        </item>
        <item>
            <title>Aura</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/04/17/aura/</link>
            <description><![CDATA[
<p>As my colleague <a href="http://blogs.igalia.com/vjaquez/">Víctor</a> at <a href="http://www.igalia.com">Igalia</a> has said before in his <a href="http://blogs.igalia.com/vjaquez/2012/04/10/aura/">post</a>, <a href="http://igalia.github.com/aura/">Aura</a> was released to the <a href="http://store.ovi.com/content/266783">Nokia Store</a>. <a href="http://blogs.igalia.com/magomez/">Miguel</a>, Víctor and I are quite happy with the result achieved with this app, which intention was to be kind of a port of the <a href="http://projects.gnome.org/cheese/">Cheese</a> application of the <a href="http://www.gnome.org">GNOME</a> platform to be used in the <a href="http://en.wikipedia.org/wiki/Nokia_N9">N9</a> or <a href="http://en.wikipedia.org/wiki/Nokia_N950">N950</a> Nokia phones.</p>
<p>The apps allows you to use both cameras (front and principal) to record videos, applying a lot of funny effects (a subset of the <a href="http://live.gnome.org/GnomeVideoEffects">GNOME Video Effects</a>) and changing them during the recording. Being Nokia a Finnish company, we decided to name the app after a <a href="https://en.wikipedia.org/wiki/Aura_%28cheese%29">Finnish Cheese</a> to both honor the GNOME Cheese application and Finland <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f609.png" alt="<span class="net_nemein_favourites">3 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=1450c7a688ad11e1b59251e884f46fe76fe7&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/1450c7a688ad11e1b59251e884f46fe76fe7/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=1450c7a688ad11e1b59251e884f46fe76fe7&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/1450c7a688ad11e1b59251e884f46fe76fe7/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Tue, 17 Apr 2012 16:23:40 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-1450c7a688ad11e1b59251e884f46fe76fe7</guid>
        </item>
        <item>
            <title>Invoking Meego 1.2 Harmattan Gallery</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/03/23/invoking-meego-1-2-harmattan-gallery/</link>
            <description><![CDATA[
<p>As part of my work at <a href="http://www.igalia.com">Igalia</a> I am writing an app to record some videos for the Nokia N9. I wanted to get them shown in the gallery so I tried the DBUS approach, that is something similar to what is explained <a href="http://www.developer.nokia.com/Community/Discussion/showthread.php?230323-Show-hide-%28start-stop%29-application-via-DBus-%28Harmattan%29">here</a>. The problem is the same they faced, meaning that I got gallery in foreground when it was not previously running, but not otherwise.</p>
<p>The solution to that was using <a href="http://harmattan-dev.nokia.com/docs/platform-api-reference/showdoc.php?pkn=libcontentaction&amp;wb=daily-docs&amp;url=Li94bWwvZGFpbHktZG9jcy9saWJjb250ZW50YWN0aW9u">libcontentaction</a>. In order to get this working, first you need to get the vendor name in the tags of your pictures or videos, otherwise Tracker will not index them correctly and this solution can be useless.</p>
<p>With the following solution Gallery will be brought to foreground and show the desired file. Code would be something like:</p>
<pre>
using ContentAction::Action;

[...]

{
    Action action =
        Action::defaultActionForFile(uri,
            "x-maemo-nepomuk/device-captured-video");
    if (action.isValid()) {
        qDebug() &lt; &lt; Q_FUNC_INFO &lt;&lt; &quot;chosen action:&quot; &lt;&lt; action.name();
        action.triggerAndWait();
    } else {
        qWarning() &lt;&lt; &quot;could not file action for&quot; &lt;&lt; m_file;
    }
}
</pre>
<p></p>
<p>The mime type is one of the defined in the <code>galleryserviceaction.desktop</code> that you can find in the device. For images, you can also check the mime types in that file and maybe you do not need to specify it, but I have not tried this and let it to you. Please, comment me your findings.</p>
<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=a1aa991674ed11e19409af40f589de69de69&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/a1aa991674ed11e19409af40f589de69de69/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=a1aa991674ed11e19409af40f589de69de69&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/a1aa991674ed11e19409af40f589de69de69/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Fri, 23 Mar 2012 12:42:52 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-a1aa991674ed11e19409af40f589de69de69</guid>
        </item>
        <item>
            <title>Mixed QML/C++ objects reloaded</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/03/19/mixed-qmlc-objects-reloaded/</link>
            <description><![CDATA[
<p>Some days ago I was <a href="http://blogs.igalia.com/xrcalvar/2012/02/24/mixed-qmlc-objects/">writing about how to have mixed QML/C++ objects</a> in a QML application for <a href="http://www.igalia.com">Igalia</a>, but I faced a problem with the code that I had written. And the problem was that I needed to receive some events and from the QML elements I was loading. Retaking that code:</p>
<pre>
#define QML_PATH "/path/to/the/qml/files/"

MyObject::MyObject(QDeclarativeItem *parent = 0) :
    QDeclarativeItem(parent)
{
    QDeclarativeEngine engine;
    QDeclarativeComponent component(&amp;engine,
        QUrl::fromLocalFile(QML_PATH "MyObject.qml"));
    QDeclarativeItem *rect =
        dynamic_cast(component.create());
    rect-&gt;setParentItem(this);
}
</pre>
<p></p>
<p>and being MyObject.qml something like:</p>
<pre>
Button {
    id: "myButton"
    text: "Do something cool"
}
</pre>
<p></p>
<p>The natural way of connecting that button to some slot you are writing would be something like:</p>
<pre>
MyObject::MyObject(QDeclarativeItem *parent = 0) :
    QDeclarativeItem(parent)
{
    QDeclarativeEngine engine;
    QDeclarativeComponent component(&amp;engine,
        QUrl::fromLocalFile(QML_PATH "MyObject.qml"));
    QDeclarativeItem *item =
        dynamic_cast(component.create());
    item-&gt;setParentItem(this);
    connect(item, SIGNAL(clicked()), this, SLOT(doCoolStuff()));
}
</pre>
<p></p>
<p>Even if you do this, you are not getting any event in the QML button you declare. It behaves as it were a label or whatever, but the key is the engine. <strong>The engine must live while you need the events of the QML component</strong>. And the easiest way of getting that done is adding the engine as a private class attribute:</p>
<pre>
#ifndef MYOBJECT_H
#define MYOBJECT_H

#include 
#include 
#include 

class PostCapture : public QDeclarativeItem
{
    Q_OBJECT

// ...

 private slots:
    void doCoolStuff();

 private:
    QDeclarativeEngine m_engine;
};
#endif
</pre>
<p></p>
<p>and of course removing the <em>engine</em> stack declaration from the constructor:</p>
<pre>
MyObject::MyObject(QDeclarativeItem *parent = 0) :
    QDeclarativeItem(parent)
{
    QDeclarativeComponent component(&amp;m_engine,
        QUrl::fromLocalFile(QML_PATH "MyObject.qml"));
    QDeclarativeItem *item =
        dynamic_cast(component.create());
    item-&gt;setParentItem(this);
    connect(item, SIGNAL(clicked()), this, SLOT(doCoolStuff()));
}
</pre>
<p></p>
<p>Voilà.</p>
<p>Of course, if you need to connect to any element that is not the root element, you can always forward the signals and properties from the QML root object or just use the <a href="http://qt-project.org/doc/qt-4.7/qobject.html#memberSection">QObject::findChild</a> method to access the right component.</p>
<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=9234384471ea11e1904d679ff26525442544&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/9234384471ea11e1904d679ff26525442544/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=9234384471ea11e1904d679ff26525442544&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/9234384471ea11e1904d679ff26525442544/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Mon, 19 Mar 2012 17:41:34 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-9234384471ea11e1904d679ff26525442544</guid>
        </item>
        <item>
            <title>Mixed QML/C++ objects</title>
            <link>http://blogs.igalia.com/xrcalvar/2012/02/24/mixed-qmlc-objects/</link>
            <description><![CDATA[
<p>One of the good things of QML is that you can have both C++ and QML code and interact between them. For example, from C++, you can access the QML tree and invoke methods, change properties, etc.</p>
<p>The other way around, you can also define C++ objects and interact with them from QML. Here you have two ways of doing it:</p>
<ul>
<li>Instantiating from C++ and adding the objects to the QML context, meaning that you can invoke the public slots and access the properties.</li>
<li>Registering the QML type with <code>qmlRegisterType</code> and then instantiating it from QML.</li>
</ul>
<p>At the Qt documentation you can find <a href="http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html">examples</a> about how to implement the different approaches so I won&#8217;t talk too much about them and I&#8217;ll focus in a special case of the last approach.</p>
<p>Let&#8217;s see a QML code like this:</p>
<pre>
Item {
    id: myObject
    function doCoolStuff() {
        // doing really cool stuff here
    }
    Rectangle {
        anchors.fill: parent
        color: "red"
    }
}

Button {
    text: "Do cool stuff!"
    onClicked: myObject.doCoolStuff()
}
</pre>
<p></p>
<p>Imagine now that painting that rectangle is something that must be really done by your object, because it is needed and inherent to it, and so is the function. If the code is written only in QML, the answer is obvious, just move the whole <code>Item</code> code to a <em>.qml</em> file and leave the main code like this:</p>
<pre>
MyObject {
    id: myObject
}

Button {
    text: "Do cool stuff!"
    onClicked: myObject.doCoolStuff()
}
</pre>
<p></p>
<p>Let&#8217;s suppose that you need some C++ code in that object for whatever reason (you want to use some GNOME library, for instance). In this case you need to write it in C++ to define the public slots in that language. Our first step would be something like this:</p>
<pre>
#include &lt;QtCore&gt;
#include &lt;QtDeclarative&gt;

 class MyObject : public QDeclarativeItem
 {
     Q_OBJECT

// Define some Q_PROPERTY here with its methods

 public slots:
     void doCoolStuff(void);

// We could even define some signals
 };
</pre>
<p></p>
<p>For the slot, it does not matter if you declare it as slot or with <code>Q_INVOKABLE</code> because QML will see it both ways. Of course, don&#8217;t forget to write the cpp file with the implementation for the slot <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f609.png" alt="<span class="net_nemein_favourites">4 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=418a28145f1f11e18e0dbb3720ec8a958a95&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/418a28145f1f11e18e0dbb3720ec8a958a95/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=418a28145f1f11e18e0dbb3720ec8a958a95&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/418a28145f1f11e18e0dbb3720ec8a958a95/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Fri, 24 Feb 2012 19:16:23 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-418a28145f1f11e18e0dbb3720ec8a958a95</guid>
        </item>
        <item>
            <title>. I travel sponsored...</title>
            <link>http://blogs.igalia.com/xrcalvar/2011/08/02/145/</link>
            <description><![CDATA[
<p><a href="https://www.desktopsummit.org/"><img src="https://www.desktopsummit.org/sites/www.desktopsummit.org/files/DS2011banner.png" alt="I'm going to Desktop Summit in Berlin 2011" /></a>.<br />
I travel sponsored by <a href="http://www.igalia.com">Igalia</a>.</p>
<span class="net_nemein_favourites">3 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=af6be046bd1e11e08f81e985899e9e249e24&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/af6be046bd1e11e08f81e985899e9e249e24/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>3 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=af6be046bd1e11e08f81e985899e9e249e24&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/af6be046bd1e11e08f81e985899e9e249e24/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Tue, 02 Aug 2011 15:39:32 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-af6be046bd1e11e08f81e985899e9e249e24</guid>
        </item>
        <item>
            <title>Being taken to Azkaban for use of very dark GStreamer magic</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/12/01/being-taken-to-azkaban-for-use-of-very-dark-gstreamer-magic/</link>
            <description><![CDATA[
<p>I was writing some tests for a project at <a href="http://www.igalia.com">Igalia</a> and I need to mock the <i>convert-frame</i> <i>playbin2 element action</i>. The code to invoke it is something like this:</p>
<pre>
GstElement *pipeline = /* get pipeline */;
GstCaps *caps = /* create caps to adapt the conversion */;
GstBuffer *buffer = NULL;
g_signal_emit_by_name (pipeline, "convert-frame", caps, &amp;buffer);
</pre>
<p></p>
<p>When you are writing tests, what you want to do is testing just your code and not to depend on something external, so in this case the idea would be providing a fake implementation for that GStreamer element action.</p>
<p>The way you can do this kind of things is providing the symbol in your code so that the linker when doing its job does not look any further and uses that instead of the one in the external library, so the natural solution coming to your mind would be rewriting <code>g_signal_emit_by_name</code>. The problem with this is that though you are not using it in your code, it is too general, so it is not a good idea.</p>
<p>I thought I could replace the <i>convert-frame</i> action in the playbin2 class, so I wrote this code:</p>
<pre>
typedef struct
{
  GstPipelineClass parent_class;
  void (*about_to_finish) (gpointer playbin);
  void (*video_changed) (gpointer playbin);
  void (*audio_changed) (gpointer playbin);
  void (*text_changed) (gpointer playbin);
  void (*video_tags_changed) (gpointer playbin, gint stream);
  void (*audio_tags_changed) (gpointer playbin, gint stream);
  void (*text_tags_changed) (gpointer playbin, gint stream);
  GstTagList *(*get_video_tags) (gpointer playbin, gint stream);
  GstTagList *(*get_audio_tags) (gpointer playbin, gint stream);
  GstTagList *(*get_text_tags) (gpointer playbin, gint stream);
  GstBuffer *(*convert_frame) (gpointer playbin, GstCaps * caps);
  GstPad *(*get_video_pad) (gpointer playbin, gint stream);
  GstPad *(*get_audio_pad) (gpointer playbin, gint stream);
  GstPad *(*get_text_pad) (gpointer playbin, gint stream);
} GstPlayBinClass;

static gpointer
gst_play_bin_convert_frame (G_GNUC_UNUSED gpointer playbin,
                            G_GNUC_UNUSED gpointer caps)
{
    GstBuffer *buffer;

    /* Create my own GstBuffer with the data I need */

    return buffer;
}

void
simulator_gst_reset(GstElement *new_pipeline, GstBus *new_bus)
{
    /* ... */

    GstPlayBinClass *klass =
        G_TYPE_INSTANCE_GET_CLASS(new_pipeline, GST_PLAY_BIN_TYPE,
                                  GstPlayBinClass);
    klass-&gt;convert_frame = (gpointer) gst_play_bin_convert_frame;

    /* ... */
}
</pre>
<p>
First I declared the GstPlayBinClass copying it from the GStreamer code. I didn&#8217;t change any parameters order, just replaced some pointers with <i>gpointer</i> as we don&#8217;t need them. This way you don&#8217;t break the ABI. Then you can declare your own element action code and finally you get the Class, assign the method and voilà!.</p>
<p>As I said, the solution is far from being the best, but if you know a better way, drop me a comment.</p>
<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=8d1ea9d8fd3911dfbe4ba316faef0c410c41&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/8d1ea9d8fd3911dfbe4ba316faef0c410c41/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=8d1ea9d8fd3911dfbe4ba316faef0c410c41&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/8d1ea9d8fd3911dfbe4ba316faef0c410c41/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Wed, 01 Dec 2010 10:10:13 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-8d1ea9d8fd3911dfbe4ba316faef0c410c41</guid>
        </item>
        <item>
            <title>Lightning talk at GUADEC in The Hague</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/07/23/lightning-talk-at-guadec-in-the-hague/</link>
            <description><![CDATA[
<p>After talking about <a href="http://live.gnome.org/Grilo">Grilo</a> at <a href="http://2010.guadec.es/">GUADEC-ES</a>, I&#8217;ll be talking next thursday about MAFWGriloSource in a lightning talk during <a href="http://www.guadec.org">GUADEC</a>. Both events are sponsored by <a href="http://www.igalia.com">Igalia</a>.</p>
<span class="net_nemein_favourites">7 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=f0d5195a964e11dfb08d8b0c9b1221902190&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/f0d5195a964e11dfb08d8b0c9b1221902190/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=f0d5195a964e11dfb08d8b0c9b1221902190&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/f0d5195a964e11dfb08d8b0c9b1221902190/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Fri, 23 Jul 2010 11:06:26 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-f0d5195a964e11dfb08d8b0c9b1221902190</guid>
        </item>
        <item>
            <title>Moving to the next page in MafwGriloSource</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/07/23/moving-to-the-next-page-in-mafwgrilosource/</link>
            <description><![CDATA[
<p>Thank Aldon Hynes, who sent me an email with some comments about MafwGriloSource behavior in the N900, I could fix a bug and implement a feature. The bug was a limitation when browsing, as you could only see the first 64 results. It was caused by a problem with indexes when returning the results, as I alwayes sent 0. When fixing this, the interface was requesting more and adding them to the treeview. Then we had all results in the treeview.</p>
<p>Then the problem I saw was that loading so many items in treeview was not slow, but a never ending story, as it took a long time to stop because we were asking for more pages until we reached the end, which took a long time.</p>
<p>I thought of a way of providing my own pagination and the first step was reverting the fix for the index bug to avoid the interface requesting more pages itself, which is a bit hacky, but it was the only way when the interface is not open. The next step was implementing a way of showing a new container row with a &#8220;More results&#8230;&#8221; label to be able to transparently carry on browsing.</p>
<p>Other dirty thing is that I need to override the count and skip parameters because now we have to pay attention to the pagination info and having only 64 results would be a pain in the ass. Do you imaging browsing the thousands and thousands of Jamendo artists in chunks of 64? I thought that 1024 was a much more reasonable number. Anyway a g_message is printed when the given count is overridden.</p>
<p>I talked to Juan about the possibility of implementing that in Grilo itself as it could be a nice of way of providing automatic pagination, but we agreed that it was better to implement the prototype at MafwGriloSource and then, if it was good enough and the model was suitable for Grilo, we could move it there.</p>
<p>How could I implement this? The easiest way was changing the way the MAFW object ids are build from the GrlMedia object. What we had so far, was <code>source_uuid::media_object_id</code>. First I thought of having a special uuid indicating that there was pagination but this would not work as MAFW really needs to parse a valid source uuid (this is, corresponding to an existing source), to send the requests to the appropriate one, so I had to discard this option.</p>
<p>Then, if I could not touch the source uuid, the next and only choice was the media object id. As the MAFW media object id is created directly from the GrlMedia id, it is an opaque string for us, so the best solution was adding the pagination information (the next element index in the list to request) and then catenating the media object id with a semicolon as separation. Result: <code>source_uuid::next_element_index:current_container_media_object_id</code>. For this, I needed to change the functions to serialize and deserialize the object id.</p>
<p>Once I had the pagination info, the only thing left should be changing the callback to return the data to check if there were results left and adding the row that you will see if you, for example, browse Jamendo artists.</p>
<p>Here you have the result:</p>
<p><a href="http://blogs.igalia.com/xrcalvar/files/2010/06/Screenshot-20100624-185432.png"><img src="http://blogs.igalia.com/xrcalvar/files/2010/06/Screenshot-20100624-185432.png" alt="Screenshot showing pagination" width="400" height="240" class="aligncenter size-full wp-image-83" /></a></p>
<p>If you find anything weird, drop me a line.</p>
<p>I have to thank <a href="http://www.igalia.com">Igalia</a> for letting use work time to finish this. </p>
<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=5530345a964711dfa5350bafd2a2e518e518&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/5530345a964711dfa5350bafd2a2e518e518/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=5530345a964711dfa5350bafd2a2e518e518&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/5530345a964711dfa5350bafd2a2e518e518/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Fri, 23 Jul 2010 10:32:08 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-5530345a964711dfa5350bafd2a2e518e518</guid>
        </item>
        <item>
            <title>GUADEC-ES</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/07/13/guadec-es/</link>
            <description><![CDATA[
<p>I&#8217;ll be attending this year <a href="http://2010.guadec.es/">GUADEC-ES</a>. I missed some of the last editions but I&#8217;d deserve my death if I didn&#8217;t go when it happens 1km away from home <img src='http://blogs.igalia.com/xrcalvar/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>I have a <a href="http://2010.guadec.es/guadec/programa">talk</a> about <a href="http://live.gnome.org/Grilo">Grilo</a> so join us if you are interested.</p>
<span class="net_nemein_favourites">1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=c093b3568e7311df951351a1b38abb40bb40&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/c093b3568e7311df951351a1b38abb40bb40/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>3 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=c093b3568e7311df951351a1b38abb40bb40&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/c093b3568e7311df951351a1b38abb40bb40/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Tue, 13 Jul 2010 11:17:08 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-c093b3568e7311df951351a1b38abb40bb40</guid>
        </item>
        <item>
            <title>GUADEC</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/06/22/75/</link>
            <description><![CDATA[
<div class="wp-caption aligncenter" style="width: 144px"><img alt="I am attending GUADEC" src="http://www.guadec.org/img/guadec-oranje.png" width="134" height="46" /><p class="wp-caption-text">I am attending GUADEC</p></div>
<span class="net_nemein_favourites">1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=849840d07deb11df97c02943ada0ccbeccbe&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/849840d07deb11df97c02943ada0ccbeccbe/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=849840d07deb11df97c02943ada0ccbeccbe&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/849840d07deb11df97c02943ada0ccbeccbe/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Tue, 22 Jun 2010 10:23:31 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-849840d07deb11df97c02943ada0ccbeccbe</guid>
        </item>
        <item>
            <title>MAFW went Grilo</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/06/07/mafw-went-grilo/</link>
            <description><![CDATA[
<p>As I explained in another <a href="http://blogs.igalia.com/xrcalvar/2010/03/02/mafw-goes-grilo/">post</a>, some colleagues at <a href="http://www.igalia.com">Igalia</a> were creating the <a href="http://live.gnome.org/Grilo">Grilo</a> framework to gather multimedia content and ease the creation of that kind of applications. The origins of Grilo are in <a href="https://garage.maemo.org/projects/mafw/">MAFW</a>, which is the multimedia application framework used in Maemo 5 (Fremantle) to power the official media player, and that we had created in collaboration with Nokia and other companies, but we wanted to go beyond its limitations and Grilo is the result.</p>
<p>We thought that we could mix both things and power MAFW with Grilo, by creating a MAFW source so that contents provided by Grilo could be accessed through MAFW and therefore, through the official Fremantle media player. I began to code that and I already got something pretty stable. You can find it at <a href="http://gitorious.org/grilo">Gitorious</a>.</p>
<p>For <a href="http://git.gnome.org/browse/grilo">grilo</a> and <a href="http://git.gnome.org/browse/grilo-plugins">grilo-plugins</a>, I created fremantle branches from the last stable release at that moment. Some plugins became useless because of two main reasons: they had already the counterpart in MAFW (such as UPnP or bookmarks) or they couldn&#8217;t be mapped correctly to MAFW, such as <a href="http://trailers.apple.com/">Apple trailers</a> (which needed a user-agent to work) or <a href="http://vimeo.com/">Vimeo</a>, which does not support browse, so I removed them from grilo-plugins fremantle branch release.</p>
<p>Other important thing I had to do was porting some plugins from GVFS back to GnomeVFS because GVFS http backend was not working propertly and it made the plugins hang.</p>
<p>It is a pity that I couldn&#8217;t rebase against the last grilo release, because of GData. The fremantle release is not working properly with Grilo, so I preferred to have the last stable release working.</p>
<p>I received some <a href="http://talk.maemo.org/showthread.php?p=696275">feedback from the Maemo community</a>. They were requesting a couple of things, but none of them is feasible or has a proper solution. First is remembering the position at least for Filesystem. Problem is that who sends the position to be stored is the interface and it only does it for the mafw-tracker-source, so it is something we cannot do if they don&#8217;t send that positions to us.</p>
<p>Other interesting feature is the search and that&#8217;s a problem. MAFW does not support search (one of MAFW limitations we corrected in Grilo), though it could be easily wrapped as a special browse. The biggest problem is the interface, which we don&#8217;t have access to. As the interface does not have any search button and has no possibility to have it, it makes the thing almost impossible. There could be the solution of adding a search container and it that was opened, we could allow selection the search string by tapping on rows with letters, but you&#8217;d need to tap and pan many times to perform the search, which makes it annoying and of course, very ugly.</p>
<p>Summing up, no search and no remembering the last position because the interface does not support those things. What I am trying to do now is getting MAFWGriloSource listed in the App Manager. Lucky that I know <a href="http://blogs.igalia.com/mario/">two</a> <a href="http://blogs.igalia.com/vjaquez/">fellow</a> <a href="http://www.igalia.com">Igalia</a>ns, who hacked on it <img src='http://blogs.igalia.com/xrcalvar/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<span class="net_nemein_favourites">8 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=689962ba722911dfbd099f535efe9a3d9a3d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/689962ba722911dfbd099f535efe9a3d9a3d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=689962ba722911dfbd099f535efe9a3d9a3d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/689962ba722911dfbd099f535efe9a3d9a3d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Mon, 07 Jun 2010 10:54:33 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-689962ba722911dfbd099f535efe9a3d9a3d</guid>
        </item>
        <item>
            <title>Lightning talk for GUADEC submitted</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/03/22/lightning-talk-for-guadec-submitted/</link>
            <description><![CDATA[
<p>My submission for this year&#8217;s GUADEC:</p>
<p>This is a _lightning talk_ about how the evolution from MAFW (Multimedia Aplication FrameWork used in Fremantle official media player) to Grilo (new multimedia framework for application aiming to provide easy access to many sources of media) and how they can work together to provide a better user experience and access to more media in the Maemo 5 platform (Fremantle)</p>
<span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=ac5b94c435c911df9b56f9fe9b80c315c315&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/ac5b94c435c911df9b56f9fe9b80c315c315/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=ac5b94c435c911df9b56f9fe9b80c315c315&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/ac5b94c435c911df9b56f9fe9b80c315c315/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Mon, 22 Mar 2010 15:10:34 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-ac5b94c435c911df9b56f9fe9b80c315c315</guid>
        </item>
        <item>
            <title>mafw goes Grilo</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/03/02/mafw-goes-grilo/</link>
            <description><![CDATA[
<p>As you may know, some colleagues at <a href="http://www.igalia.com">Igalia</a> are developing a framework to gather, browse and query multimedia sources called <a href="http://gitorious.org/grilo">Grilo</a>. Of course it is no replacement for <a href="http://www.gstreamer.net/">GStreamer</a> as it is at a much higher level and we are focusing in gathering, browsing and querying so far.</p>
<p>We were an important part of the main developers of <a href="https://garage.maemo.org/projects/mafw">MAFW</a>, so in this case we are trying to learn from the mistakes and try to create a more useful and easy to use framework.</p>
<p>One of my first steps, as a test, will be creating a MAFW pluging for Grilo, so that we can have all sources managed by Grilo running on the Fremantle official media player (as soon as <a href="https://bugs.maemo.org/show_bug.cgi?id=9361">bug 9361</a> gets fixed) with the consequence of having integrated important and interesting features as <a href="http://www.youtube.com">Youtube</a>, podcasts, <a href="http://www.jamendo.com">Jamendo</a>, <a href="http://www.shoutcast.com/">Shoutcast</a> and so on.</p>
<span class="net_nemein_favourites">7 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=9e0ba0b025f911dfb02477458a3dfe37fe37&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/9e0ba0b025f911dfb02477458a3dfe37fe37/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=9e0ba0b025f911dfb02477458a3dfe37fe37&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/9e0ba0b025f911dfb02477458a3dfe37fe37/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Tue, 02 Mar 2010 11:53:43 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-9e0ba0b025f911dfb02477458a3dfe37fe37</guid>
        </item>
        <item>
            <title>Seekability and DLNA in MAFW</title>
            <link>http://blogs.igalia.com/xrcalvar/2010/02/26/seekability-and-dlna-in-mafw/</link>
            <description><![CDATA[
<p>Seekability when streaming contents involves almost all layers of a multimedia player and it is not a trivial issue. First, your interface needs to have a seekbar or something to do that. Of course, the media you are streaming has to seekable, meaning container and codecs used. And we cannot forget the transport either, this is, HTTP, local access and so on.</p>
<p>Thank Gods, <a href="http://www.gstreamer.net/">GStreamer</a> does a wonderful job making easier everything related to transport, decoding, containers, etc. But in the case of <a href="http://en.wikipedia.org/wiki/Universal_Plug_and_Play#UPnP_AV_standards">UPnP</a>-<a href="http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance">DLNA</a>, there is a extension saying if the media you are playing is seekable or not.</p>
<p>We did not have support for that in MAFW and we needed it, I added the request for the metadata key <code>MAFW_METADATA_KEY_IS_SEEKABLE</code> when requesting data to play media, so now we have duration, uri and seekability. Our approach had to be consevative (otherwise, GStreamer seekability would have been enough), and then if MAFW source provides the metadata key and media is not seekable, se just say it is not seekable. Otherwise, we rely on GStreamer, that has the final responsibility (which is logical, if it cannot seek, seeking is impossible). Of course, seekability depends on duration, meaning, if there is no duration, we cannot seek as we would not know the seeking limits.</p>
<p>About how to implement that in the sources, the only one needing it was <i>mafw-upnp-source</i>. In the other ones we just want to rely on GStreamer, but for UPnP, if we want to honor DLNA specification, we had to do that. Specification is fun itself and of course, adding that every vendor/provider implements what it wants makes it more difficult. A proof is that a friend of mine bought a TV claiming to be DLNA certified and it only works with the crappy server provided by the vendor, closed of course, and with a lot of missing features, like subtitles support, IIRC (yes Zeenix, I told him to use Rygel and Philippe, it was before you joining Igalia :-p). Now with new <code>gupnp</code> this was reworked, but when I wrote it, we had to check the <code>DLNA_OP</code> fields to know if it was seekable or not and it was a pain in the ass to decide what the default was depending on the missing options and so on.</p>
<p>Fortunately, it is working fine now, I think.</p>
<span class="net_nemein_favourites">9 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=435818bc22c311df8df8fbc3e1cef2baf2ba&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/435818bc22c311df8df8fbc3e1cef2baf2ba/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=435818bc22c311df8df8fbc3e1cef2baf2ba&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/435818bc22c311df8df8fbc3e1cef2baf2ba/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Xabier Rodriguez Calvar &lt;xrcalvar@igalia.com&gt;</author>
            <category>feed:70bebeb934a26428d85371654b6c3163</category>
            <pubDate>Fri, 26 Feb 2010 09:42:26 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-435818bc22c311df8df8fbc3e1cef2baf2ba</guid>
        </item>
    </channel>
</rss>
