Compiling mod_h264_streaming for lighttpd

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
cp lighttpd-1.4.18/src/moov.* src
cp lighttpd-1.4.18/src/mod_h264* src

add these lines to src/Makefile.am around line 266:
lib_LTLIBRARIES += mod_h264_streaming.la
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c moov.c
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_h264_streaming_la_LIBADD = $(common_libadd)

./autogen.sh
./configure --prefix=/opt/local

make

At this point, I ran into an error with the plugin:

[...]
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'
[...]

Looking around, it seems to be an incompatibility between mac os x and *nix. I found a patch for a similar problem in navit, which loads the right library and function aliases.

Here’s my diff:

--- 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 
+#include

+#define bswap_16 OSSwapInt16
+#define bswap_32 OSSwapInt32
+#define bswap_64 OSSwapInt64
 #include 
 #define DIR_SEPARATOR '/'
-#endif

 uint64_t atoi64(const char* val)
 {

After that, you can just continue merrily on..

make
make install

The directions for testing the plugin are a little buried on the maintainer’s site, but once I found them, everything seemed in order.

Posted in Uncategorized.

Tagged with , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.