heyujie
2021-10-15 aba91dc00cd79653c4867c954434b0adff035598
hikptz.go
@@ -1,37 +1,39 @@
package hikvoice
package hikControl
/*
#cgo CFLAGS: -I${SRCDIR}/include -w -g
#cgo LDFLAGS: -L${SRCDIR}/libs
#cgo LDFLAGS: -lHikVoice -lAudioRender -lHCCore -lhcnetsdk -lhpr
#cgo LDFLAGS: -ldl -lm
#cgo CXXFLAGS: -I${SRCDIR}/include -w -g
#cgo LDFLAGS: -L${SRCDIR}/lib
#cgo LDFLAGS: -lhcnetsdk -lhpr -lHCCore
#include <stdlib.h>
#include "hikptz.h"
*/
import "C"
import (
    "unsafe"
   "unsafe"
)
// SendVoice Send Voice
func PtzTrack(ip,password,port,userName string, channel,xBottom,xTop,yBottom,yTop int)  {
   cip := C.CString(ip)
    defer C.free(unsafe.Pointer(cip))
    cusrname := C.CString(userName)
    defer C.free(unsafe.Pointer(cusrname))
    cpasswd := C.CString(password)
    defer C.free(unsafe.Pointer(cpasswd))
    cport := C.CString(port)
    defer C.free(unsafe.Pointer(cport))
func PtzTrack(ip, userName, password string, port, channel, xBottom, xTop, yBottom, yTop int) {
   C.PtzTrack(cip, cusrname, cpasswd, cport, C.int(channel),C.int(xBottom),C.int(xTop),C.int(yBottom),C.int(yTop) )
   cIp := C.CString(ip)
   cUsrname := C.CString(userName)
   cPasswd := C.CString(password)
   defer C.free(unsafe.Pointer(cIp))
   defer C.free(unsafe.Pointer(cUsrname))
   defer C.free(unsafe.Pointer(cPasswd))
   C.ptzTrack(cIp, cUsrname, cPasswd, C.int(port), C.int(channel), C.int(xBottom), C.int(xTop), C.int(yBottom), C.int(yTop))
}
func ToPreset(ip, userName, password string, port, ch int) {
func ToPreset(ip,password,port,userName string, ch int)  {
}
   cip := C.CString(ip)
   defer C.free(unsafe.Pointer(cip))
   cusrname := C.CString(userName)
   defer C.free(unsafe.Pointer(cusrname))
   cpasswd := C.CString(password)
   defer C.free(unsafe.Pointer(cpasswd))
   C.toPreset(cip, cusrname, cpasswd, C.int(port), C.int(ch))
}