<?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>Musings &#187; lighttpd</title>
	<atom:link href="http://cbeer.info/blog/tag/lighttpd/feed/" rel="self" type="application/rss+xml" />
	<link>http://cbeer.info/blog</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 22:14:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Compiling mod_h264_streaming for lighttpd</title>
		<link>http://cbeer.info/blog/2009/12/08/compiling-mod_h264_streaming-for-lighttpd/</link>
		<comments>http://cbeer.info/blog/2009/12/08/compiling-mod_h264_streaming-for-lighttpd/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 15:01:02 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[h264]]></category>
		<category><![CDATA[lighttpd]]></category>

		<guid isPermaLink="false">http://authoritativeopinion.com/blog/?p=258</guid>
		<description><![CDATA[In compiling the mod_h264_streaming module for lighttpd on Mac OS 10.4 (Tiger), I hit a few snags following these directions. From the directions, the first half went smoothly: wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.25.tar.gz tar -xvzf lighhttpd-1.4.25.tar.gz cd lighttpd-1.4.25 wget http://h264.code-shop.com/download/lighttpd-1.4.18_mod_h264_streaming-2.2.0.tar.gz tar -zxvf lighttpd-1.4.18_mod_h264_streaming-2.2.0.tar.gz &#8230; <a href="http://cbeer.info/blog/2009/12/08/compiling-mod_h264_streaming-for-lighttpd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In compiling the <a href="http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Lighttpd-Version2">mod_h264_streaming module for lighttpd</a> on Mac OS 10.4 (Tiger), I hit a few snags following <a href="http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Lighttpd-Version2">these directions</a>.</p>
<p>From the directions, the first half went smoothly:</p>
<pre name="code" class="bash">
wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.25.tar.gz
tar -xvzf lighhttpd-1.4.25.tar.gz
cd lighttpd-1.4.25
wget http://h264.code-shop.com/download/lighttpd-1.4.18_mod_h264_streaming-2.2.0.tar.gz
tar -zxvf lighttpd-1.4.18_mod_h264_streaming-2.2.0.tar.gz
cp lighttpd-1.4.18/src/moov.* src
cp lighttpd-1.4.18/src/mod_h264* src
</pre>
<p>add these lines to src/Makefile.am around line 266:<br />
lib_LTLIBRARIES += mod_h264_streaming.la<br />
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c moov.c<br />
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined<br />
mod_h264_streaming_la_LIBADD = $(common_libadd)</p>
<pre name="code" class="bash">
./autogen.sh
./configure --prefix=/opt/local

make
</pre>
<p>At this point, I ran into an error with the plugin:</p>
<pre name="code" class="bash">
[...]
moov.c:77:22: error: byteswap.h: No such file or directory
moov.c: In function 'byteswap16':
moov.c:96: warning: implicit declaration of function 'bswap_16'
moov.c: In function 'byteswap32':
moov.c:105: warning: implicit declaration of function 'bswap_32'
moov.c: In function 'esds_read':
moov.c:1941: warning: unused parameter 'size'
[...]
</pre>
<p>Looking around, it seems to be an incompatibility between mac os x and *nix. I found a patch for <a href="http://trac.navit-project.org/ticket/104">a similar problem in navit</a>, which loads the right library and function aliases.</p>
<p>Here&#8217;s my diff:</p>
<pre class="diff" name="code">
--- lighttpd-1.4.18/src/moov.c  2009-06-27 03:58:50.000000000 -0400
+++ src/moov.c  2009-12-07 16:49:50.000000000 -0500
@@ -73,11 +73,12 @@
 #define DIR_SEPARATOR '\\'
 #endif

-#ifndef WIN32
-#include <byteswap.h>
+#include
<libkern/OSByteOrder.h>
+#define bswap_16 OSSwapInt16
+#define bswap_32 OSSwapInt32
+#define bswap_64 OSSwapInt64
 #include <dirent.h>
 #define DIR_SEPARATOR '/'
-#endif

 uint64_t atoi64(const char* val)
 {
</pre>
<p>After that, you can just continue merrily on..</p>
<pre name="code" class="bash">
make
make install
</pre>
<p>The directions for <a href="http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Testing-Version2">testing the plugin</a> are a little buried on the maintainer&#8217;s site, but once I found them, everything seemed in order.</p>
]]></content:encoded>
			<wfw:commentRss>http://cbeer.info/blog/2009/12/08/compiling-mod_h264_streaming-for-lighttpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
