http://antognolli.org/Antognolli's blog2011-12-07T02:00:00ZRafael Antognollihttp://antognolli.orgtag:antognolli.org,2011-12-07:/posts/linuxcon_brazil_2011/LinuxCon Brazil presentation2011-12-07T02:00:00Z2011-12-07T02:00:00Z<p>Recently I attended at LinuxCon Brazil, did a presentation and still had the chance to attend to some interesting talks.</p>
<p>The presentation was given together with <a href="http://brunodilly.org/blog/" title="bdilly's blog">Bruno Dilly</a>, about <a href="http://www.enlightenment.org/" title="Enlightenment Foundation Libraries">EFL</a> focused on embedded devices. Besides some previous similar talks about <a href="http://www.enlightenment.org/" title="Enlightenment Foundation Libraries">EFL</a>, this one was more interesting and quite different, since we didn’t talk much about how to write a program using it, but instead focused on its advantages, presented some real use cases and tried to show off where one can take more advantages from these libraries.</p>
<p>You can see the presentation slides online on <a href="http://brunodilly.org/blog/?p=32">Bruno Dilly’s post</a>, or get the slides <a href="http://antognolli.org/files/LinuxConBrazil-2011.pdf">here</a>.</p>
<p>Overall the event was very interesting, with some nice keynotes and presentations. Two of them that draw my attention were Eugeni Dodonov’s talk about the Linux Graphical Stack, and Daniel Frye’s keynote about the 10+ years of Linux at IBM, which exposed how IBM’s LTC (Linux Technology Center) started trying to contribute with Linux, what they did wrong and how they fixed it.</p>
<p>In addition to our talk, 2 more guys from <a href="http://profusion.mobi/">ProFUSION</a> were presenting their talks: <a href="http://www.politreco.com/2011/11/linuxcon-brazil/">Lucas DeMarchi did a talk about how to become an open source developer</a> and <a href="http://blog.gustavobarbieri.com.br/">Gustavo Barbieri</a> presented two talks: “Tips and Tricks to Develop Software for CE product on Low-End Hardware” and “Demystifying HTML5” with Sulamita Garcia (Intel).</p>
<p>That’s all for now, and hopefully there will be more presentations coming on next events.</p>
tag:antognolli.org,2011-09-27:/posts/emotion_generic_vlc_backend/Emotion backend: generic2011-09-27T03:00:00Z2011-09-27T03:00:00Z<p>Emotion is the <a href="http://www.enlightenment.org/" title="Enlightenment Foundation Libraries">EFL</a> library that handles audio and video playback. It had only
two backends: <em>gstreamer</em> and <em>xine</em>. But recently, <a href="http://www.zodiacaerospace.com/">Zodiac Aerospace</a> asked
<a href="http://profusion.mobi/">ProFUSION</a> to integrate a <a href="http://www.videolan.org/vlc/">VLC</a> backend that was being developed originally by
Hugo Camboulive. After analyzing his current work, we figured out that it could
be used to integrate not only VLC, but other players. The end result of
this work is a <em>generic</em> backend and a brand new vlc plugin for it.</p>
<p>This generic backend executes a separated player (its plugin) in another
process. It receives the bytes to be drawn on the Emotion object through
a shared memory, and communicates/controls the player through a pipe. The pipe
file descriptors to be used are sent to the player through command line
arguments, leaving the standard input/output free to be used if necessary.</p>
<p>The player must receive and send commands defined on a common file called
<code>Emotion_Generic_Plugin.h</code>, which can be included for easier implementation.
However, there’s no need for the player to link against Emotion.</p>
<h4 id="how-does-it-work">How does it work?</h4>
<p>When the module is initialized for an emotion object, it starts another process
that runs the specified player. The player command line is specified using:</p>
<pre><code class="language-c">emotion_object_module_option_set(object, <span class="string"><span class="delimiter">"</span><span class="content">player</span><span class="delimiter">"</span></span>, <command_to_player>);</code></pre>
<p>A player using libvlc is being provided now, and the generic module internally
checks if the command given was “vlc”, in which case it will use this provided
emotion-vlc player.</p>
<p>When a file is set to this object, Emotion sends the file name to the player,
and expects an answer that will tell that the player already decoded a bit of
the file, and the video size is already set on the module, so it can allocate a
shared memory with correct size.</p>
<p>The module then allocates the memory, sends a message to the player and expects
an answer. After this last answer, the “open_done” signal is sent and the
module knows that it is ready for playing. Commands issued before the module
being ready are now applied (and play is resumed if necessary).</p>
<p>During this setup stage, info about the file set will be stored in the module,
so commands like meta data get, length get and so will be available to sync
calls like emotion_object_play_length_get().</p>
<p>The playback phase occurs by VLC writing the decoded video data on a shared
memory buffer, which will be used by Emotion to display the decoded frame. A
triple buffering mechanism is used to avoid tearing, and also ensures that no
blocking happens on Emotion when the player is writing the pixels on the buffer.</p>
<p>If the player dies for any reason, a “decode_stop” signal is sent, allowing the
program to call play again, and in that case it will be restarted. The playback
should start from the same point it was before the player crashed (if the player
supports seek on the current media format).</p>
<p>This last point is the main advantage of the generic backend, allowing the
program to recover from a player crash. Similar plugins can be implemented using
gstreamer and xine, isolating the decode from the program UI using a separated
process.</p>
<p>If you have any questions about this backend, please feel free to ask =).</p>
tag:antognolli.org,2011-09-26:/posts/post_number_one/Post number 1!2011-09-26T03:00:00Z2011-09-26T03:00:00Z<p>Well, I’m finally putting my blog online, and hope to have some interesting
stuff to post here. I’ll be probably talking a lot about work that I’m doing on
<a href="http://www.enlightenment.org/" title="Enlightenment Foundation Libraries">EFL</a>, and sometimes on [WebKit] too. And since I’ve been lately also doing
some stuff in the game development area, you can also expect some posts on this
topic too.</p>
<p>This blog is also powered by <a href="http://nanoc.stoneship.org/">nanoc</a>, so I’m probably going to share some
thoughts and code for this awesome framework. Although it’s very simple now, I
should improve it a little in the near future (but not too much). And at least
I plan to publish the template used for this blog, that could be a good start
for anyone wanting to start a blog with nanoc with the setup already done. This
way maybe I also receive some critics on the way that I implemented things, and
can change it to something better.</p>