<?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>Nito</title>
	<atom:link href="http://blog.pirelenito.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pirelenito.org</link>
	<description>Thoughts dump yard</description>
	<lastBuildDate>Tue, 20 Jul 2010 01:53:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Developers, working to create abstracions</title>
		<link>http://blog.pirelenito.org/2010/02/developers-working-to-create-abstracions/</link>
		<comments>http://blog.pirelenito.org/2010/02/developers-working-to-create-abstracions/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 00:39:04 +0000</pubDate>
		<dc:creator>nito</dc:creator>
				<category><![CDATA[Software Development Culture]]></category>
		<category><![CDATA[abstraction]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[responsability]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://blog.pirelenito.org/?p=80</guid>
		<description><![CDATA[Everyday software development is composed mostly of non scientific related problems, meaning less time working on complex new algorithms, and more doing simple, action-reaction development, like UI, database queries, reports and so on. Meaning that the bulk of our everyday tasks should involve more effort on how to organize and write the code than how [...]]]></description>
			<content:encoded><![CDATA[<p>Everyday software development is composed mostly of non scientific related problems, meaning less time working on complex new algorithms, and more doing simple, action-reaction development, like UI, database queries, reports and so on. Meaning that the <strong>bulk of our everyday tasks</strong> should involve more effort on how to <strong>organize</strong> and write the code than how to solve a particular problem, thinking more on <strong>abstractions and code interactions</strong> ratter than the algorithms themselves.</p>
<p>It is like that lazy developer that delivers a simple functionality, like an UI interaction, but through a highly coupled and dispersed solution, with code being written in places it shouldn&#8217;t be. Sure it could be said that the value was delivered, but a big amount of legacy code was created in the process, and that is because the developer is focusing on the easy part of the task, the algorithm, ratter than a proper abstraction to define it.</p>
<p>It is easy to make something work, but making it maintainable, that is another story. We should, as developers, <strong>excel at creating abstractions. This is our real job.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pirelenito.org/2010/02/developers-working-to-create-abstracions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java movie playback: JOGL + Fobs4JMF</title>
		<link>http://blog.pirelenito.org/2008/08/java-movie-playback-jogl-fobs4jmf/</link>
		<comments>http://blog.pirelenito.org/2008/08/java-movie-playback-jogl-fobs4jmf/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 23:37:45 +0000</pubDate>
		<dc:creator>nito</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[Fobs4JMF]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[JMF]]></category>
		<category><![CDATA[JOGL]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[RGB]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[VideoRenderer]]></category>

		<guid isPermaLink="false">http://blog.pirelenito.org/?p=12</guid>
		<description><![CDATA[Recently I had to integrate video playback on my job&#8217;s Java OpenGL engine, which uses JOGL. Java has a support to media playback through it&#8217;s Java Media Framework, which unfortunately, on it&#8217;s current version (2.1.1e) does not support many formats for video playback. So I quickly looked for alternatives, including IBM Toolkit for mpeg4, that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to integrate <strong>video playback</strong> on my job&#8217;s <strong>Java OpenGL</strong> engine, which uses <a href="https://jogl.dev.java.net/" target="_blank">JOGL</a>.</p>
<p>Java has a support to media playback through it&#8217;s <a href="http://java.sun.com/javase/technologies/desktop/media/jmf/" target="_blank">Java Media Framework</a>, which unfortunately, on it&#8217;s current version (2.1.1e) does not support many <a href="http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/formats.html" target="_blank">formats for video playback</a>.</p>
<p>So I quickly looked for alternatives, including <a href="http://www.alphaworks.ibm.com/tech/tk4mpeg4" target="_blank">IBM Toolkit for mpeg4</a>, that hadn&#8217;t a sufficient production performance I was looking for, and didn&#8217;t offer an easy option for frame grabbing or plugin extensions as JMF does.</p>
<p>Next was <a href="http://fobs.sourceforge.net/" target="_blank">Fobs4JMF</a>, which is <a href="http://java.sun.com/javase/technologies/desktop/media/jmf/" target="_blank">JMF</a> + <a href="http://ffmpeg.org/" target="_blank">ffmpeg</a>. This solution was much more interesting, since it offers a <strong>wide variety of codecs</strong> (ogg, mp3, m4a, divx, xvid, h264, mov, etc) and is based on the solid ffmpeg solution to decode audio and video.</p>
<p>My implementation, uses the plug-in capabilities of JMF to extend a custom renderer that does a pixel type conversion and rendering to a texture:</p>
<div style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/-zh6yDyasSo&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/-zh6yDyasSo&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object></div>
<p><span id="more-12"></span></p>
<p>This custom renderer works with RGB textures, a type I seemed to made work on my two test machines:</p>
<ul>
<li>MacBook with a Integ GMA x3100 &#8211; Leopard;</li>
<li>PC with a Radeon x600 &#8211; Debian.</li>
</ul>
<p>You might wanna try different pixel types to increase the performance on different target machines.</p>
<p>First, lets describe <strong>how the Renderer works:</strong></p>
<p>It got to be an implementation of a <em>javax.media.renderer.VideoRenderer</em> since it will be installed as a <strong>plugin on JMF</strong>.</p>
<p>For the different methods we need to implement, there are a few we need to take proper care of:</p>
<ul>
<li><strong>process</strong>: this is the method JMF calls passing the movie&#8217;s current frame buffer, here we process the buffer so that we can latter render it in OpenGL;</li>
<li><strong>getSupportedInputFormats</strong>: we return RGBFormat, our target texture format;</li>
<li><strong>setInputFormat</strong>: here we simply tell JMF that the format it chooses is the one we want. Since RGB was the only one we returned as supported, there is not much to do here as well.</li>
<li><strong>getName</strong>: returns the renderer neat name!</li>
</ul>
<p>Next we need a way to access this renderer outside of the JMF world, so that we can get the texture to render it on the teapot. For this purpose our class must also be a <em>javax.media.Control,</em> then we can easily get it through an <em>getControl</em> call, such as:</p>
<blockquote><p>player.getControl(&#8220;javax.media.renderer.VideoRenderer&#8221;);</p></blockquote>
<p>So we implement:</p>
<ul>
<li><strong>getControl</strong>: returns it&#8217;s instance;</li>
<li><strong>getControls</strong>: returns an array containing only it&#8217;s instance as a valid control.</li>
</ul>
<p>The renderer implementation is <em><a href="http://github.com/pirelenito/MovieGL/blob/master/src/org/pirelenito/multimedia/jmf/plugin/RGBGLTextureRenderer.java">org.pirelenito.multimedia.jmf.plugin.RGBGLTextureRenderer</a></em>.</p>
<p>And also, to make further development easy, there is an <a href="http://github.com/pirelenito/MovieGL/blob/master/src/org/pirelenito/multimedia/jmf/plugin/IGLTextureRenderer.java">IGLTextureRenderer</a> interface with the public methods called by the Canvas:</p>
<ul>
<li><strong>render</strong>: that plots the buffer on the texture surface;</li>
<li><strong>getTexture</strong>: to retrieve the texture instance.</li>
</ul>
<p>Last but not least important, you will need to <strong>register the renderer</strong> on JMF, this is done through the <em>JMFRegistry</em> application. The easiest way to start it is inside Eclipse, where our custom renderer is already on the class path:</p>
<ul>
<li>Create a new run configuration;</li>
<li>Set the main class as: JMFRegistry;</li>
<li>Start it, and go to the Plugins tab, then Renderer;</li>
<li>Add the org.pirelenito.multimedia.jmf.plugin.RGBGLTextureRenderer;</li>
<li>Move it to the top of the list;</li>
<li>Push Commit, and you are good to go!</li>
</ul>
<p>To test it out there is also a <a href="http://github.com/pirelenito/MovieGL/blob/master/src/org/pirelenito/multimedia/jmf/MoviePlayer.java">helper class</a> to instantiate the movie player, and a <a href="http://github.com/pirelenito/MovieGL/blob/master/src/org/pirelenito/movieGL/Main.java">Main</a> class which is an OpenGL canvas used to render the teapot with the texture on its surface.</p>
<p>I am not very experienced with OpenGL, so there might be <strong>more effitient ways</strong> to do this using, for instance, <strong>PBO</strong> (Pixel Buffer Object). If you have any question or suggestions on how to improve this solution, don&#8217;t hesitate on drooping a comment!</p>
<p><a href="http://github.com/pirelenito/MovieGL">Here is the project&#8217;s repository</a>. You will need to download a few dependencies, so check the Readme file for more information.</p>
<p><span style="text-decoration: line-through;"><strong>Update:</strong> I wasn&#8217;t properly initializing the Texture. and since I want to add support for more pixel formats, it is easy for you to checkout the updated Eclipse project at: <a href="http://labs.pirelenito.org/experiments/svn/java/MovieGL/" target="_blank">http://labs.pirelenito.org/experiments/svn/java/MovieGL/</a><del datetime="2008-08-21T20:34:00+00:00"> latter this afternoon</del> now.</span></p>
<p><span style="text-decoration: line-through;"><strong>Update 2:</strong> Added the <a href="http://labs.pirelenito.org/experiments/svn/java/MovieGL/" target="_blank">repository link</a> on the image above.</span></p>
<p><span style="text-decoration: line-through;"><strong>Update 3:</strong> I&#8217;ve migrated my server to a new location, and the Subversion wasn&#8217;t up until today. Sorry.</span></p>
<p><strong>Update 4:</strong> Small review on the post.</p>
<p><strong>Update 5:</strong> Moved the repository to <a href="http://github.com/pirelenito/MovieGL">github</a>.</p>
<p>Cheers! <img src='http://blog.pirelenito.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pirelenito.org/2008/08/java-movie-playback-jogl-fobs4jmf/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Fixing Wii noisy drive.</title>
		<link>http://blog.pirelenito.org/2008/07/fixing-wii-noisy-drive/</link>
		<comments>http://blog.pirelenito.org/2008/07/fixing-wii-noisy-drive/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 01:51:36 +0000</pubDate>
		<dc:creator>nito</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Wii]]></category>
		<category><![CDATA[disk drive]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[noisy]]></category>

		<guid isPermaLink="false">http://blog.pirelenito.org/?p=9</guid>
		<description><![CDATA[It&#8217;s been more than 6 months that my Wii was producing an awful lawn mower sound in the disk drive, and I finally decided to open it up and &#8220;try&#8221; to fix the problem. Since I&#8217;ve seen other people with similar problems on YouTube, such as: I decided to put my experience on how I [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been more than 6 months that my <strong>Wii</strong> was producing an awful <a href="http://en.wikipedia.org/wiki/Lawn_mower" target="_blank">lawn mower</a> sound in the <strong>disk drive</strong>, and I finally decided to <strong>open it up</strong> and &#8220;try&#8221; to <strong>fix</strong> the problem.</p>
<p>Since I&#8217;ve seen other people with <strong>similar problems</strong> on YouTube, such as:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/12-NW8SEnME&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/12-NW8SEnME&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object></p>
<p>I decided to put my experience on how <strong>I fixed it</strong>.</p>
<p>You will need <strong>Nintendo screwdriver</strong>, which you can easily find on eBay.</p>
<p>I&#8217;ve used the following video as a guide during the <strong>disassembling</strong> of my console:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/g8epujddQTc&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/g8epujddQTc&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object></p>
<p>Now how I did it:</p>
<p>There is <strong>one screw above your Wii&#8217;s drive</strong> that is right above the power button, <strong>loose it a little</strong> and <strong>stick something</strong> to level the plate a little bit up. You can <strong>test</strong> this with your Wii still opened until you <strong>don&#8217;t hear that noise</strong> anymore.</p>
<p>Here is a front picture of my fixed Wii (<a href="http://www.flickr.com/photos/pirelenito/2665570671/">follow the link to see the Flickr notes</a>):</p>
<p><a title="Front of my Wii open. by pirelenito, on Flickr" href="http://www.flickr.com/photos/pirelenito/2665570671/"><img src="http://farm4.static.flickr.com/3114/2665570671_0d7dbdfe0b_m.jpg" alt="Front of my Wii open." width="240" height="180" /></a></p>
<p>I should have taken a picture from above, but I was too happy that the problem was gone, that I just remember to register how I did it after most of my Wii had been put back together already.</p>
<p>Hope it helps someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pirelenito.org/2008/07/fixing-wii-noisy-drive/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

