From 498de554006005c6f02b9d9db622c5f6e226baf9 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 26 Jul 2009 11:09:22 +0000 Subject: [PATCH] [package] use stable mjpg-streamer version, add init, config files and hotplug support, patch from Roberto Riggio git-svn-id: svn://svn.openwrt.org/openwrt/packages@17002 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- multimedia/mjpg-streamer/Makefile | 16 +++++++++------ .../mjpg-streamer/files/mjpg-streamer.config | 6 ++++++ .../mjpg-streamer/files/mjpg-streamer.hotplug | 11 +++++++++++ multimedia/mjpg-streamer/files/mjpg-streamer.init | 23 ++++++++++++++++++++++ .../patches/001-no_input_testpictures.patch | 11 ----------- 5 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 multimedia/mjpg-streamer/files/mjpg-streamer.config create mode 100644 multimedia/mjpg-streamer/files/mjpg-streamer.hotplug create mode 100644 multimedia/mjpg-streamer/files/mjpg-streamer.init diff --git a/multimedia/mjpg-streamer/Makefile b/multimedia/mjpg-streamer/Makefile index b6e6fc0d7..38871ddd2 100644 --- a/multimedia/mjpg-streamer/Makefile +++ b/multimedia/mjpg-streamer/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2009 OpenWrt.org +# Copyright (C) 2006-2009 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -25,7 +25,7 @@ define Package/mjpg-streamer CATEGORY:=Multimedia TITLE:=MJPG-streamer DEPENDS:=@LINUX_2_6 +libpthread +libjpeg - URL:=http://www.naaa.de/uvc_streamer.htm + URL:=http://mjpg-streamer.wiki.sourceforge.net/ endef define Package/mjpg-streamer/description @@ -35,13 +35,17 @@ endef EXTRA_CFLAGS += $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) define Package/mjpg-streamer/install - $(INSTALL_DIR) $(1)/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/sbin + $(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 + $(CP) ./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)/webcam_www - $(CP) $(PKG_BUILD_DIR)/www/* $(1)/webcam_www + $(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/multimedia/mjpg-streamer/files/mjpg-streamer.config b/multimedia/mjpg-streamer/files/mjpg-streamer.config new file mode 100644 index 000000000..1b1f7d7f9 --- /dev/null +++ b/multimedia/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/multimedia/mjpg-streamer/files/mjpg-streamer.hotplug b/multimedia/mjpg-streamer/files/mjpg-streamer.hotplug new file mode 100644 index 000000000..c6f29cc3d --- /dev/null +++ b/multimedia/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/multimedia/mjpg-streamer/files/mjpg-streamer.init b/multimedia/mjpg-streamer/files/mjpg-streamer.init new file mode 100644 index 000000000..7b92c899d --- /dev/null +++ b/multimedia/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/multimedia/mjpg-streamer/patches/001-no_input_testpictures.patch b/multimedia/mjpg-streamer/patches/001-no_input_testpictures.patch index 8ae90be3d..e69de29bb 100644 --- a/multimedia/mjpg-streamer/patches/001-no_input_testpictures.patch +++ b/multimedia/mjpg-streamer/patches/001-no_input_testpictures.patch @@ -1,11 +0,0 @@ -diff -urN mjpg-streamer-r74/Makefile mjpg-streamer-r74.new/Makefile ---- mjpg-streamer-r74/Makefile 2009-02-08 14:51:37.000000000 +0100 -+++ mjpg-streamer-r74.new/Makefile 2009-02-08 14:52:48.000000000 +0100 -@@ -31,7 +31,6 @@ - PLUGINS = input_uvc.so - PLUGINS += output_file.so - PLUGINS += output_http.so --PLUGINS += input_testpicture.so - PLUGINS += output_autofocus.so - PLUGINS += input_gspcav1.so - PLUGINS += input_file.so -- 2.11.0