<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Damien Lespiau &#187; Clutter</title>
	<atom:link href="http://damien.lespiau.name/blog/category/clutter/feed/" rel="self" type="application/rss+xml" />
	<link>http://damien.lespiau.name/blog</link>
	<description>errands</description>
	<lastBuildDate>Sat, 17 Sep 2011 00:37:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Clutter on Android: first results</title>
		<link>http://damien.lespiau.name/blog/2011/05/31/clutter-on-android-first-results/</link>
		<comments>http://damien.lespiau.name/blog/2011/05/31/clutter-on-android-first-results/#comments</comments>
		<pubDate>Tue, 31 May 2011 14:41:27 +0000</pubDate>
		<dc:creator>damien</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Clutter]]></category>

		<guid isPermaLink="false">http://damien.lespiau.name/blog/?p=232</guid>
		<description><![CDATA[With the release of Android 2.3, there&#8217;s a decent way to integrate native applications with the NativeActivity class, an EGL library, and some C API to expose events, main loop, etc. So? how about porting Clutter to it now that it looks actually feasible? After a few days of work, the first results are there, [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of Android 2.3, there&#8217;s a <em>decent</em> way to  integrate native applications with the NativeActivity class, an EGL  library, and some C API to expose events, main loop, etc. So? how about porting Clutter to it now that it looks actually feasible? After a few days of work, the first results are there, quite promising!</p>
<p style="text-align: center;"><video src="http://damien.lespiau.name/files/blog/clutter-android.ogv" controls>Your browser does not support the <code>video</code> element. Download the <a href="http://damien.lespiau.name/files/blog/clutter-android.ogv">original source</a>.</video>
<p>There&#8217;s still a fairly large number of items in my TODO before being happy with the state of this work, the most prominent items are:</p>
<ul>
<li>Get a clean up pass done to have something upstreamable, this includes finishing the event integration (it receives events but not yet forward them to Clutter),</li>
<li>Come up with a plan to manage the application life cycle and handle the case when Android destroys the EGL surface that you were using (probably by having the app save a state, and properly tear down Clutter).,</li>
<li>While you probably have the droid font installed in /system/fonts, this is not part of the advertised NDK interface. The safest choice is to  embed the font you want to use with your application. Unfortunately  fontconfig + freetype + pango + compressed assets in your Android package don&#8217;t work really well together. Maybe solve it at the Pango level with a custom &#8220;direct&#8221; fontmap implementation that would let you register fonts from files easily?</li>
<li>What to do with text entries? show soft keyboard? Mx or Clutter problem? what happens to the GL surface in that case?</li>
<li>Better test the GMainLoop/ALooper main loop integration (esp. adding and removing file descriptors),</li>
<li>All the libraries that Clutter depends on are linked into a big .so (which is the Android NDK application). It results in a big .so (~5 MB, ~1.7 MB compressed in the .apk). That size can be dramatically reduced, sometimes at the expense of changes that will break the current API/ABI, but hell, you&#8217;ll be statically linking anyway,</li>
<li>Provide &#8220;prebuilt libraries&#8221;, ie. pre-compiled libraries that makes it easy to just use Clutter to build applications.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://damien.lespiau.name/blog/2011/05/31/clutter-on-android-first-results/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
<enclosure url="http://damien.lespiau.name/files/blog/clutter-android.ogv" length="1616469" type="video/ogg" />
		</item>
		<item>
		<title>A simple transition effect with Clutter</title>
		<link>http://damien.lespiau.name/blog/2011/05/10/a-simple-transition-effect-with-clutter/</link>
		<comments>http://damien.lespiau.name/blog/2011/05/10/a-simple-transition-effect-with-clutter/#comments</comments>
		<pubDate>Tue, 10 May 2011 14:06:08 +0000</pubDate>
		<dc:creator>damien</dc:creator>
				<category><![CDATA[Clutter]]></category>

		<guid isPermaLink="false">http://damien.lespiau.name/blog/?p=204</guid>
		<description><![CDATA[When doing something with graphics, your first need an idea (granted, as with pretty much everything else). In this case, a simple transition that I&#8217;ve seen somewhere a long time ago and I wanted to reproduce with Clutter. Your browser does not support the video element. Download the original source. The code is available in [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">When doing something with graphics, your first need an idea (granted, as with pretty much everything else). In this case, a simple transition that I&#8217;ve seen somewhere a long time ago and I wanted to reproduce with Clutter.</p>
<p style="text-align: center;"><video src="http://damien.lespiau.name/files/blog/tileout-effect.ogv" controls>Your browser does not support the <code>video</code> element. Download the <a href="http://damien.lespiau.name/files/blog/tileout-effect.ogv">original source</a>.</video>
<p>The code is available in a <a title="wip/tileout-effect branch" href="https://github.com/media-explorer/media-explorer/tree/wip%2Ftileout-effect">branch</a> of a <a title="media explorer" href="http://media-explorer.github.com/">media explorer</a> I&#8217;m currently working on. A few bullet points to follow the code:</p>
<ul>
<li>As the effect needs a &#8220;screenshot&#8221; of a Clutter scene to play with. You first need to create a subclass of <code>ClutterOffscreenEffect</code> as it does the work of redirecting the painting of a subtree of actors in an offscreen buffer that you can  reuse to texture the rectangles you&#8217;ll be animating in the effect. This subclass has a &#8220;progress&#8221; property to control the animation.</li>
<li>Then actually compute the coordinates of the grid cells both in screen space and in texture space. To be able to use <code>cogl_rectangles_with_texture_coords()</code>, to try limit the number of GL calls (and/or by the Cogl journal and to ease the animation of the cells fading out, I decided to store the diagonals of the rectangle in a 1D array so that the following grid:</li>
</ul>
<p style="text-align: center;"><a href="http://damien.lespiau.name/blog/wp-content/uploads/2011/05/grild-diagonals.png"><img class="size-full wp-image-209" title="grild-diagonals" src="http://damien.lespiau.name/blog/wp-content/uploads/2011/05/grild-diagonals.png" alt="a 5x5 grid with one color per diagonal line" width="281" height="281" /></a></p>
<p style="text-align: left;">is stored as:</p>
<p style="text-align: center;"><a href="http://damien.lespiau.name/blog/wp-content/uploads/2011/05/tileout-1d-rects.png"><img class="size-full wp-image-210 alignnone" title="tileout-1d-rects" src="http://damien.lespiau.name/blog/wp-content/uploads/2011/05/tileout-1d-rects.png" alt="A 1D array with all the diagonals of the grid" width="561" height="57" /></a></p>
<ul>
<li><code>::paint_target()</code>looks at the &#8220;progress&#8221; property, animate those grid cells accordingly and draw them. <code>priv-&gt;rects</code> is the array storing the initial rectangles, <code>priv-&gt;animated_rects</code> the animated ones and <code>priv-&gt;chunks</code> stores the start and duration of each diagonal animation along with a (index, length) tuple that references the diagonal rectangles in priv-&gt;rects and priv-&gt;animated_rects.</li>
</ul>
<p>Some more details:</p>
<ul>
<li>in the <code>::paint_target()</code> function, you can special case when the progress is 0.0 (paint the whole FBO instead of the textured grid) and 1.0 (don&#8217;t do anything),</li>
<li>Clutter does not currently allow to just rerun the effect when you animate a property of an offscreen effect for instance. This means that when animating the &#8220;progress&#8221; property on the effect, it queues a redraw on the actor that end up in the offscreen to trigger the effect <code>::paint_target()</code> again. A branch from <a title="Neil" href="http://busydoingnothing.co.uk/">Neil</a> allows to queue a &#8220;rerun&#8221; on the effect to avoid having to do that,</li>
<li>The code has some limitations right now (ie, n_colums must be equal to n_rows) but easily fixable. Once done, it makes sense to try to push the effect to <a title="Mx" href="https://github.com/clutter-project/mx">Mx</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://damien.lespiau.name/blog/2011/05/10/a-simple-transition-effect-with-clutter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://damien.lespiau.name/files/blog/tileout-effect.ogv" length="219913" type="video/ogg" />
		</item>
		<item>
		<title>The GStreamer conference from a Clutter point of view</title>
		<link>http://damien.lespiau.name/blog/2010/11/16/the-gstreamer-conference-from-a-clutter-point-of-view/</link>
		<comments>http://damien.lespiau.name/blog/2010/11/16/the-gstreamer-conference-from-a-clutter-point-of-view/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 19:30:21 +0000</pubDate>
		<dc:creator>damien</dc:creator>
				<category><![CDATA[Clutter]]></category>
		<category><![CDATA[GNOME]]></category>

		<guid isPermaLink="false">http://damien.lespiau.name/blog/?p=193</guid>
		<description><![CDATA[Two weeks ago I attended the first GStreamer conference, and it was great. I won&#8217;t talk about the 1.0 plan that seems to take shape and looks really good but just what stroke me the most: Happy Clutter Stories and an Tale To Be Told to your manager. Let&#8217;s move on the Clutter stories. You [...]]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago I attended<a href="http://gstreamer.freedesktop.org/conference/"> the first GStreamer conference</a>, and it was great. I won&#8217;t talk about the 1.0 plan that seems to take shape and looks really good but just what stroke me the most: Happy Clutter Stories and an Tale To Be Told to your manager.</p>
<p>Let&#8217;s move on the Clutter stories. You had a surprising number of people mixing GStreamer and Clutter, two talks especially:</p>
<ul>
<li>Florent Thiery founder of <a href="http://www.ubicast.eu">Ubicast</a> talked about one of their products: a<a href="http://www.ubicast.eu/en/Products/easycast/"> portable recording system</a> with quite a bit of bling (records the slides, movement detection with OpenCV, RoI, &#8230;). The system was used to <a href="http://gstreamer-devel.966125.n4.nabble.com/GStreamer-Conference-2010-Talks-Recordings-td3043270.html#a3043270">record the talks on the main track</a>. Now, what was of particular interest for me is that the UI to control the system is entirely written with Clutter and python. They have built a whole toolkit on top of Clutter, in python, called <a href="https://launchpad.net/candies">candies</a>/<a href="https://launchpad.net/touchwizard">touchwizard</a> and written their UI with it, cooool.</li>
<li>A very impressive talk from the <a href="http://www.tandberg.com/">Tanberg</a> (now Cisco) guys about their <a href="http://www.tandberg.com/">Movi software</a>, video conferencing at its finest. It uses GStreamer extensively and Clutter for its UI (on Windows!). They said that about 150,000 copies of Movi are deployed in the wild. Patches from Ole André Vadla Ravnås and Haakon Sporsheim have been flowing to Clutter and Clutter-gst (win32 support).</li>
</ul>
<p>As a side note, Fluendo talked about their Open Source, Intel founded, <a href="https://core.fluendo.com/gstreamer/trac/browser/trunk/gst-fluendo-ismd">GStreamer codecs</a> for Intel CE3100/CE4100. This platform specificities are supported natively by Clutter (./configure &#8211;with-flavour=cex100) using the native EGL winsys called &#8220;GDL&#8221; and evdev events coming from the kernel. More on this later :p</p>
<p>A very interesting point about those success stories is that the companies and engineers working with open source software to build their applications, sometimes with parts heavily covered by patents, <strong>while</strong> contributing back to the ecosystem that allowed to build those applications in the first place. Contributing is done at many levels: directly patches but also feedback on the libraries/platform (eg. input for GStreamer 1.0). And guess what? It works! To me, that&#8217;s exactly how the GNOME platform should be used to build proprietary applications: build on top and contribute back to consolidate the libraries. I&#8217;d go as far as saying that contributing upstream is the best way to share code inside the same big corporation. Such companies are always very bad a cooperating between divisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://damien.lespiau.name/blog/2010/11/16/the-gstreamer-conference-from-a-clutter-point-of-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cogl + JS = Love</title>
		<link>http://damien.lespiau.name/blog/2009/09/21/cogl-js-love/</link>
		<comments>http://damien.lespiau.name/blog/2009/09/21/cogl-js-love/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 16:59:38 +0000</pubDate>
		<dc:creator>damien</dc:creator>
				<category><![CDATA[Clutter]]></category>

		<guid isPermaLink="false">http://damien.lespiau.name/blog/?p=138</guid>
		<description><![CDATA[Played a bit with Gjs and Cogl this weekend and ended up rewriting Clutter&#8217;s test-cogl-primitives in JavaScript. In the unlikely case someone is interested in trying it, you&#8217;ll need a patch to support arrays of float as argument in introspected functions and another small patch to add introspection annotations for a few Cogl symbols. As [...]]]></description>
			<content:encoded><![CDATA[<p>Played a bit with <a title="Gjs" href="http://live.gnome.org/Gjs">Gjs</a> and <a href="http://www.clutter-project.org/docs/cogl/stable/">Cogl</a> this weekend and ended up rewriting Clutter&#8217;s test-cogl-primitives in JavaScript. In the unlikely case someone is interested in trying it, you&#8217;ll need a <a href="https://bugzilla.gnome.org/show_bug.cgi?id=593245">patch to support arrays of float as argument in introspected functions</a> and another small <a href="http://bugzilla.openedhand.com/show_bug.cgi?id=1817">patch to add introspection annotations for a few Cogl symbols</a>. As usual you can grab the code in<a href="http://git.lespiau.name/cgit/clutter-gjs-examples/"> its git repository</a>:</p>
<p><img class="aligncenter size-full wp-image-140" title="cogl-primitives-js" src="http://damien.lespiau.name/blog/wp-content/uploads/2009/09/cogl-primitives-js.png" alt="cogl-primitives-js" width="418" height="454" /></p>
]]></content:encoded>
			<wfw:commentRss>http://damien.lespiau.name/blog/2009/09/21/cogl-js-love/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

