Skip to content

Commit

Permalink
AP_Scripting: video-stream-info gets topotek support
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Dec 4, 2024
1 parent 5b755c5 commit 222505b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions libraries/AP_Scripting/applets/video-stream-information.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ local PARAM_TABLE_PREFIX = "VID1_"

local MAV_SEVERITY = {EMERGENCY=0, ALERT=1, CRITICAL=2, ERROR=3, WARNING=4, NOTICE=5, INFO=6, DEBUG=7}
local VID_TYPE_ENUM = {RTSP=0, RTPUDP=1, TCP_MPEG=2, MPEG_TS=3}
local CAMMODEL_ENUM = {UNKNOWN=0, SIYI_A8=1, SIYI_ZR10=2, SIYI_ZR30=3, SIYI_ZT30_ZOOM=4, SIYI_ZT30_WIDE=5, SIYI_ZT30_IR=6, SIYI_ZT6_RGB=7, SIYI_ZT6_IR=8, HERELINK_WIFIAP=9, HERELINK_USB_TETHERING=10}
local CAMMODEL_ENUM = {UNKNOWN=0, SIYI_A8=1, SIYI_ZR10=2, SIYI_ZR30=3, SIYI_ZT30_ZOOM=4, SIYI_ZT30_WIDE=5,
SIYI_ZT30_IR=6, SIYI_ZT6_RGB=7, SIYI_ZT6_IR=8, HERELINK_WIFIAP=9, HERELINK_USB_TETHERING=10,
TOPOTEK_1080P=11, TOPOTEK_480P=12}
local TEXT_PREFIX_STR = "video-stream-information:"
local SIYI_IP_DEFAULT = '192.168.144.25:8554'
local TOPOTEK_IP_DEFAULT = '192.168.144.108:554'

-- add a parameter and bind it to a variable
function bind_add_param(name, idx, default_value)
Expand All @@ -24,7 +27,7 @@ end
// @Param: VID1_CAMMODEL
// @DisplayName: Camera1 Video Stream Camera Model
// @Description: Video stream camera model
// @Values: 0:Unknown, 1:Siyi A8, 2:Siyi ZR10, 3:Siyi ZR30, 4:Siyi ZT30 Zoom, 5:Siyi ZT30 Wide, 6:Siyi ZT30 IR, 7:Siyi ZT6 RGB, 8:Siyi ZT6 IR, 9:Herelink WifiAP, 10:Herelink USB-tethering
// @Values: 0:Unknown, 1:Siyi A8, 2:Siyi ZR10, 3:Siyi ZR30, 4:Siyi ZT30 Zoom, 5:Siyi ZT30 Wide, 6:Siyi ZT30 IR, 7:Siyi ZT6 RGB, 8:Siyi ZT6 IR, 9:Herelink WifiAP, 10:Herelink USB-tethering, 11:Topotek 1080p, 12:Topotek 480p
// @User: Standard
--]]
-- values should match CAMMODEL_ENUM
Expand Down Expand Up @@ -213,6 +216,16 @@ function set_video_stream_information()
uri_ip = '192.168.42.129:8554'
uri_suffix = '/fpv_stream'
end
if VID1_CAMMODEL:get() == CAMMODEL_ENUM.TOPOTEK_1080P then
uri_ip = TOPOTEK_IP_DEFAULT
uri_suffix = '/stream=0'
hfov = 50
end
if VID1_CAMMODEL:get() == CAMMODEL_ENUM.TOPOTEK_480P then
uri_ip = TOPOTEK_IP_DEFAULT
uri_suffix = '/stream=1'
hfov = 50
end

-- calculate hfov
if VID1_HFOV:get() ~= 0 then
Expand Down

0 comments on commit 222505b

Please sign in to comment.