Skip to content

Commit

Permalink
add new types for independent zoom and pan tilt
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Dec 23, 2022
1 parent 37d8a71 commit 9d65ca2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
10 changes: 5 additions & 5 deletions ptz/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@ type ContinuousMove struct {
XMLName string `xml:"tptz:ContinuousMove"`
ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"`
Velocity onvif.PTZSpeed `xml:"tptz:Velocity"`
Timeout xsd.Duration `xml:"tptz:Timeout"`
//Timeout xsd.Duration `xml:"tptz:Timeout"`
}

type ContinuousMoveResponse struct {
}

type RelativeMove struct {
XMLName string `xml:"tptz:RelativeMove"`
ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"`
Translation onvif.PTZVector `xml:"tptz:Translation"`
Speed onvif.PTZSpeed `xml:"tptz:Speed"`
XMLName string `xml:"tptz:RelativeMove,omitempty"`
ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken,omitempty"`
Translation onvif.PTZVector `xml:"tptz:Translation,omitempty"`
Speed onvif.PTZSpeed `xml:"tptz:Speed,omitempty"`
}

type RelativeMoveResponse struct {
Expand Down
26 changes: 16 additions & 10 deletions xsd/onvif/onvif.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,20 +547,26 @@ type PTZConfiguration struct {
Extension PTZConfigurationExtension `xml:"Extension"`
}

type PTZSpeed struct {
PanTilt Vector2D `xml:"onvif:PanTilt"`
Zoom Vector1D `xml:"onvif:Zoom"`
type PTZSpeed interface {
}

type PTZSpeedZoom struct {
Zoom Vector1D `xml:"onvif:Zoom,omitempty"`
}

type PTZSpeedPanTilt struct {
PanTilt Vector2D `xml:"onvif:PanTilt,omitempty"`
}

type Vector2D struct {
X float64 `xml:"x,attr"`
Y float64 `xml:"y,attr"`
Space xsd.AnyURI `xml:"space,attr"`
X float64 `xml:"x,attr,omitempty"`
Y float64 `xml:"y,attr,omitempty"`
Space xsd.AnyURI `xml:"space,attr,omitempty"`
}

type Vector1D struct {
X float64 `xml:"x,attr"`
Space xsd.AnyURI `xml:"space,attr"`
X float64 `xml:"x,attr,omitempty"`
Space xsd.AnyURI `xml:"space,attr,omitempty"`
}

type PanTiltLimits struct {
Expand Down Expand Up @@ -1013,8 +1019,8 @@ type PTZPreset struct {
}

type PTZVector struct {
PanTilt Vector2D `xml:"onvif:PanTilt"`
Zoom Vector1D `xml:"onvif:Zoom"`
PanTilt Vector2D `xml:"onvif:PanTilt,omitempty"`
Zoom Vector1D `xml:"onvif:Zoom,omitempty"`
}

type PTZStatus struct {
Expand Down

0 comments on commit 9d65ca2

Please sign in to comment.