From: Bernhard Tittelbach Date: Mon, 22 Mar 2010 00:26:47 +0000 (+0000) Subject: patched mjpg-streamer by xro X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=e2e2cb075275db3bdc08ca1bc52a4be7dde38a52;p=svn42.git patched mjpg-streamer by xro --- diff --git a/openwrt-packages/mjpg-streamer/Makefile b/openwrt-packages/mjpg-streamer/Makefile new file mode 100644 index 0000000..63eb6ba --- /dev/null +++ b/openwrt-packages/mjpg-streamer/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mjpg-streamer +PKG_REV:=94 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer/mjpg-streamer/ +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +include $(INCLUDE_DIR)/package.mk + +define Package/mjpg-streamer + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=MJPG-streamer + DEPENDS:=@LINUX_2_6 +libpthread +libjpeg + URL:=http://mjpg-streamer.wiki.sourceforge.net/ +endef + +define Package/mjpg-streamer/description + Streaming application for Linux-UVC compatible webcams +endef + +EXTRA_CFLAGS += $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) + +define Package/mjpg-streamer/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(foreach input_plugin,file uvc gspcav1,$(PKG_BUILD_DIR)/input_$(input_plugin).so) $(1)/usr/lib + $(CP) $(foreach output_plugin,http file autofocus,$(PKG_BUILD_DIR)/output_$(output_plugin).so) $(1)/usr/lib + $(INSTALL_DIR) $(1)/etc/hotplug.d/usb + $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer +endef + +$(eval $(call BuildPackage,mjpg-streamer)) diff --git a/openwrt-packages/mjpg-streamer/files/mjpg-streamer.config b/openwrt-packages/mjpg-streamer/files/mjpg-streamer.config new file mode 100644 index 0000000..1b1f7d7 --- /dev/null +++ b/openwrt-packages/mjpg-streamer/files/mjpg-streamer.config @@ -0,0 +1,6 @@ +config mjpg-streamer core + option device "/dev/video0" + option resolution "640x480" + option fps "5" + option port "8080" + option enabled "true" diff --git a/openwrt-packages/mjpg-streamer/files/mjpg-streamer.hotplug b/openwrt-packages/mjpg-streamer/files/mjpg-streamer.hotplug new file mode 100644 index 0000000..c6f29cc --- /dev/null +++ b/openwrt-packages/mjpg-streamer/files/mjpg-streamer.hotplug @@ -0,0 +1,11 @@ +case "$ACTION" in + add) + # start process + /etc/init.d/mjpg-streamer start + ;; + remove) + # stop process + /etc/init.d/mjpg-streamer stop + ;; +esac + diff --git a/openwrt-packages/mjpg-streamer/files/mjpg-streamer.init b/openwrt-packages/mjpg-streamer/files/mjpg-streamer.init new file mode 100644 index 0000000..7b92c89 --- /dev/null +++ b/openwrt-packages/mjpg-streamer/files/mjpg-streamer.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org +START=50 + +SSD=start-stop-daemon +NAME=mjpg_streamer +PIDF=/var/run/$NAME.pid +PROG=/usr/bin/$NAME + +start() { + config_load mjpg-streamer + config_get device core device + config_get resolution core resolution + config_get fps core fps + config_get port core port + config_get_bool enabled core enabled + [ $enabled -gt 0 -a -c $device ] && sleep 3 && $SSD -S -m -p $PIDF -q -x $PROG -- --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so --port $port" & +} + +stop() { + $SSD -K -p $PIDF +} + diff --git a/openwrt-packages/mjpg-streamer/patches/001-zc3xx.patch b/openwrt-packages/mjpg-streamer/patches/001-zc3xx.patch new file mode 100644 index 0000000..658363c --- /dev/null +++ b/openwrt-packages/mjpg-streamer/patches/001-zc3xx.patch @@ -0,0 +1,21 @@ +--- ../spcav4l.c.orig 2010-03-21 22:49:39.884260157 +0100 ++++ ./plugins/input_gspcav1/spcav4l.c 2010-03-22 01:08:39.746758410 +0100 +@@ -45,7 +45,7 @@ + {BRIDGE_SPCA561,"SPCA561"}, + {BRIDGE_SPCA536,"SPCA536"}, + {BRIDGE_SONIX,"SN9C102"}, +- {BRIDGE_ZC3XX,"ZC301-2"}, ++ {BRIDGE_ZC3XX,"zc3xx"}, + {BRIDGE_CX11646,"CX11646"}, + {BRIDGE_TV8532,"TV8532"}, + {BRIDGE_ETOMS,"ET61XX51"}, +@@ -892,7 +892,8 @@ + break; + case VIDEO_PALETTE_YUV420P: + { +- depth = (8 * 3) >> 1; ++ //depth = (8 * 3) >> 1; ++ depth = 8; + } + break; + case VIDEO_PALETTE_RGB565: