Le Sunday 26 July 2009 12:10:43 roberto.rig...@create-net.org, vous avez 
écrit :
> Changes:
>
>  - use version
>  - add config and init script
>  - add hotplug support (start the video server qhen the usb cam is plugged)

Applied in r17002. Thanks !

>
>
> Signed-off-by: roberto.rig...@create-net.org
>
> --
>
> Index: mjpg-streamer/files/mjpg-streamer.init
> ===================================================================
> --- mjpg-streamer/files/mjpg-streamer.init    (revision 0)
> +++ mjpg-streamer/files/mjpg-streamer.init    (revision 0)
> @@ -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
> +}
> +
>
> Property changes on: mjpg-streamer/files/mjpg-streamer.init
> ___________________________________________________________________
> Added: svn:executable
>    + *
>
> Index: mjpg-streamer/files/mjpg-streamer.config
> ===================================================================
> --- mjpg-streamer/files/mjpg-streamer.config  (revision 0)
> +++ mjpg-streamer/files/mjpg-streamer.config  (revision 0)
> @@ -0,0 +1,6 @@
> +config mjpg-streamer core
> +     option device           "/dev/video0"
> +     option resolution       "640x480"
> +     option fps              "5"
> +     option port             "8080"
> +     option enabled          "true"
> Index: mjpg-streamer/files/mjpg-streamer.hotplug
> ===================================================================
> --- mjpg-streamer/files/mjpg-streamer.hotplug (revision 0)
> +++ mjpg-streamer/files/mjpg-streamer.hotplug (revision 0)
> @@ -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
> +
> Index: mjpg-streamer/patches/001-no_input_testpictures.patch
> ===================================================================
> --- mjpg-streamer/patches/001-no_input_testpictures.patch     (revision 16991)
> +++ mjpg-streamer/patches/001-no_input_testpictures.patch     (working copy)
> @@ -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
> Index: mjpg-streamer/Makefile
> ===================================================================
> --- mjpg-streamer/Makefile    (revision 16991)
> +++ mjpg-streamer/Makefile    (working copy)
> @@ -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 @@
>    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 @@
>  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))
> Index: uvc-streamer/files/uvc-streamer.init
> ===================================================================
> --- uvc-streamer/files/uvc-streamer.init      (revision 16991)
> +++ uvc-streamer/files/uvc-streamer.init      (working copy)
> @@ -1,51 +0,0 @@
> -#!/bin/sh /etc/rc.common
> -# Copyright (C) 2008 OpenWrt.org
> -START=50
> -
> -SSD=start-stop-daemon
> -NAME=uvc_streamer
> -PIDF=/var/run/$NAME.pid
> -PROG=/sbin/$NAME
> -
> -append_bool() {
> -     local section="$1"
> -     local option="$2"
> -     local value="$3"
> -     local _val
> -     config_get_bool _val "$section" "$option" '0'
> -     [ "$_val" -gt 0 ] && append args "$3"
> -}
> -
> -append_string() {
> -     local section="$1"
> -     local option="$2"
> -     local value="$3"
> -     local _val
> -     config_get _val "$section" "$option"
> -     [ -n "$_val" ] && append args "$3 $_val"
> -}
> -
> -start_service() {
> -     local section="$1"
> -     args=""
> -     append_string "$section" device "-d"
> -     append_string "$section" resolution "-r"
> -     append_bool "$section" framespersecond "-f"
> -     append_string "$section" port "-p"
> -     config_get_bool "enabled" "$section" "enabled" '1'
> -     [ "$enabled" -gt 0 ] && sleep 5s && $SSD -S -p $PIDF -q -x $PROG -- -b
> $args & -}
> -
> -stop_service() {
> -     $SSD -K -p $PIDF
> -}
> -
> -start() {
> -     config_load "uvc-streamer"
> -     config_foreach start_service "uvc-streamer"
> -}
> -
> -stop() {
> -     config_load "uvc-streamer"
> -     config_foreach stop_service "uvc-streamer"
> -}
> Index: uvc-streamer/files/uvc-streamer.config
> ===================================================================
> --- uvc-streamer/files/uvc-streamer.config    (revision 16991)
> +++ uvc-streamer/files/uvc-streamer.config    (working copy)
> @@ -1,6 +0,0 @@
> -config uvc-streamer
> -     option device          '/dev/video0'
> -     option resolution      '640x480'
> -     option framespersecond '5'
> -     option port            '8080'
> -     option enabled         '1'
> Index: uvc-streamer/Makefile
> ===================================================================
> --- uvc-streamer/Makefile     (revision 16991)
> +++ uvc-streamer/Makefile     (working copy)
> @@ -1,49 +0,0 @@
> -#
> -# Copyright (C) 2007 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:=uvc-streamer
> -PKG_VERSION:=1
> -PKG_RELEASE:=1
> -
> -PKG_SOURCE:=uvc_streamer_2007_07_21_14.07.06.tgz
> -PKG_SOURCE_URL:=http://naaa.de/programme/uvc_streamer/
> -PKG_MD5SUM:=491473a25882c3e7250aeeb68e0ca689
> -
> -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
> -
> -include $(INCLUDE_DIR)/package.mk
> -
> -define Package/uvc-streamer
> -  SECTION:=utils
> -  CATEGORY:=Utilities
> -  TITLE:=Linux-UVC streaming applicaton
> -  DEPENDS:=...@linux_2_6 +libpthread
> -  URL:=http://www.naaa.de/uvc_streamer
> -endef
> -
> -define Package/uvc-streamer/description
> -     This package contains a streaming daemon for Linux-UVC based webcams
> -endef
> -
> -MAKE_FLAGS += \
> -     -C $(PKG_BUILD_DIR) \
> -     CFLAGS="$(TARGET_CFLAGS)" \
> -     CC="$(TARGET_CC)" \
> -     all
> -
> -define Package/uvc-streamer/install
> -     $(INSTALL_DIR) $(1)/sbin
> -     $(INSTALL_BIN) $(PKG_BUILD_DIR)/uvc_stream $(1)/sbin/uvc_streamer
> -     $(INSTALL_DIR) $(1)/etc/config
> -     $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
> -     $(INSTALL_DIR) $(1)/etc/init.d
> -     $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
> -endef
> -
> -$(eval $(call BuildPackage,uvc-streamer))
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel



-- 
Best regards, Florian Fainelli
Email: flor...@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
-------------------------------

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to