12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package isapi
- import (
- "net/url"
- )
- type RegionCoordinates struct {
- PositionX string `xml:"positionX"`
- PositionY string `xml:"positionY"`
- }
- // TamperDetectionRegionList 配置指定通道视频遮盖所有区域参数
- type TamperDetectionRegionList struct {
- TamperDetectionRegion []struct {
- ID string `xml:"id"`
- Enabled bool `xml:"enabled"`
- SensitivityLevel int `xml:"sensitivityLevel"`
- RegionCoordinatesList struct {
- RegionCoordinates []RegionCoordinates `xml:"RegionCoordinates"`
- } `xml:"RegionCoordinatesList"`
- } `xml:"TamperDetectionRegion"`
- }
- // TamperDetection 获取指定通道视频遮盖参数
- type TamperDetection struct {
- Enabled string `xml:"enabled"`
- NormalizedScreenSize struct {
- NormalizedScreenWidth string `xml:"normalizedScreenWidth"`
- NormalizedScreenHeight string `xml:"normalizedScreenHeight"`
- } `xml:"normalizedScreenSize"`
- TampersensitivityLevel string `xml:"tampersensitivityLevel"`
- TamperDetectionRegionList TamperDetectionRegionList
- }
- // GetTamperDetection 获取指定通道视频遮盖参数
- func (c *Client) GetTamperDetection() ([]byte, error) {
- return c.CommonGet("/ISAPI/System/Video/inputs/channels/1/tamperDetection")
- }
- // PutTamperDetection 配置指定通道视频遮盖参数
- func (c *Client) PutTamperDetection(data []byte) (resp []byte, err error) {
- return c.CommonPut(data, "/ISAPI/System/Video/inputs/channels/1/tamperDetection")
- }
- // DelTamperDetection 清除指定通道视频遮盖参数
- func (c *Client) DelTamperDetection() (resp []byte, err error) {
- u, err := url.Parse(c.BaseURL + "/ISAPI/System/Video/inputs/channels1/tamperDetection/regions")
- if err != nil {
- return nil, err
- }
- var data = TamperDetection{}
- data.TamperDetectionRegionList.TamperDetectionRegion = nil
- resp, err = c.DeleteXML(u, nil)
- if err != nil {
- return nil, err
- }
- return resp, nil
- }
|