X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-uvc_streamer%2Fluasrc%2Fmodel%2Fcbi%2Fuvc_streamer.lua;h=469ea6f009aebe4aa7b63998d92a278d78426700;hp=69a65251218ea6273eebeed1c6dc37cf89140d03;hb=7c765875884d6866c53b63757731b079bace2e9b;hpb=87bed5db45430fd69d7d89b30e1c6dae46d05e7c diff --git a/applications/luci-uvc_streamer/luasrc/model/cbi/uvc_streamer.lua b/applications/luci-uvc_streamer/luasrc/model/cbi/uvc_streamer.lua index 69a652512..469ea6f00 100644 --- a/applications/luci-uvc_streamer/luasrc/model/cbi/uvc_streamer.lua +++ b/applications/luci-uvc_streamer/luasrc/model/cbi/uvc_streamer.lua @@ -1,20 +1,47 @@ -m = Map("uvc-streamer", translate("uvc_streamer")) +--[[ -s = m:section(TypedSection, "uvc-streamer", translate("settings")) +LuCI UVC Streamer +(c) 2008 Yanira + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +]]-- + +-- find current lan address and port of first uvc_streamer config section +local uci = luci.model.uci.cursor_state() +local addr = uci:get("network", "lan", "ipaddr") +local port + +uci:foreach( "uvc-streamer", "uvc-streamer", + function(section) port = port or tonumber(section.port) end ) + +addr = addr or "192.168.1.1" +port = port or 8080 + +m = Map("uvc-streamer", translate("Webcam streaming"), + translatef("uvc_streamer_desc", nil, addr, port, addr, port)) + +s = m:section(TypedSection, "uvc-streamer", translate("Settings")) s.addremove = false s.anonymous = true -s:option(Flag, "enabled", translate("enabled", "Enable")) +s:option(Flag, "enabled", translate("Enable")) -s:option(Value, "device", translate("device")).rmempty = true +s:option(Value, "device", translate("Device")).rmempty = true -nm = s:option(Value, "resolution", translate("resolution")) +nm = s:option(Value, "resolution", translate("Resolution")) nm:value("640x480") nm:value("320x240") nm:value("160x120") -s:option(Value, "framespersecond", translate("framespersecond")).rmempty = true +s:option(Value, "framespersecond", translate("Frames per second")).rmempty = true -s:option(Value, "port", translate("port", "Port")).rmempty = true +s:option(Value, "port", translate("Port")).rmempty = true return m