Documentation
¶
Overview ¶
Package server provides ONVIF server implementation for testing and simulation.
Index ¶
- Variables
- type AbsoluteFocus
- type AbsoluteMoveRequest
- type AbsoluteMoveResponse
- type AnalyticsCapabilities
- type AudioEncoderConfig
- type AudioEncoderConfiguration
- type AudioSourceConfig
- type AudioSourceConfiguration
- type BacklightCompensation
- type BacklightCompensationOptions
- type BacklightCompensationSettings
- type Bounds
- type Capabilities
- type Config
- type ContinuousFocus
- type ContinuousMoveRequest
- type ContinuousMoveResponse
- type DeviceCapabilities
- type DeviceInfo
- type EventCapabilities
- type ExposureOptions
- type ExposureSettings
- type ExposureSettings20
- type FloatRange
- type FocusConfiguration20
- type FocusMove
- type FocusOptions
- type FocusSettings
- type GetCapabilitiesResponse
- type GetConfigurationsResponse
- type GetDeviceInformationResponse
- type GetImagingSettingsRequest
- type GetImagingSettingsResponse
- type GetOptionsRequest
- type GetOptionsResponse
- type GetPresetsRequest
- type GetPresetsResponse
- type GetProfilesResponse
- type GetServicesResponse
- type GetSnapshotURIResponse
- type GetStatusRequest
- type GetStatusResponse
- type GetStreamURIResponse
- type GetVideoSourcesResponse
- type GotoPresetRequest
- type GotoPresetResponse
- type H264Configuration
- type IOCapabilities
- type IPAddress
- type ImagingCapabilities
- type ImagingOptions
- type ImagingSettings
- type ImagingState
- type IntRectangle
- type MediaCapabilities
- type MediaProfile
- type MediaURI
- type MetadataConfiguration
- type MoveRequest
- type MoveResponse
- type MulticastConfiguration
- type NetworkCapabilities
- type PTZCapabilities
- type PTZConfig
- type PTZConfiguration
- type PTZConfigurationExt
- type PTZMoveStatus
- type PTZPosition
- type PTZPreset
- type PTZSpeed
- type PTZState
- type PTZStatus
- type PTZVector
- type PanTiltLimits
- type Preset
- type ProfileConfig
- type Range
- type Rectangle
- type RelativeFocus
- type RelativeMoveRequest
- type RelativeMoveResponse
- type Resolution
- type SecurityCapabilities
- type Server
- func (s *Server) GetConfig() *Config
- func (s *Server) GetImagingState(videoSourceToken string) (*ImagingState, bool)
- func (s *Server) GetPTZState(profileToken string) (*PTZState, bool)
- func (s *Server) GetStreamConfig(profileToken string) (*StreamConfig, bool)
- func (s *Server) HandleAbsoluteMove(body interface{}) (interface{}, error)
- func (s *Server) HandleContinuousMove(body interface{}) (interface{}, error)
- func (s *Server) HandleGetCapabilities(body interface{}) (interface{}, error)
- func (s *Server) HandleGetDeviceInformation(body interface{}) (interface{}, error)
- func (s *Server) HandleGetImagingSettings(body interface{}) (interface{}, error)
- func (s *Server) HandleGetOptions(body interface{}) (interface{}, error)
- func (s *Server) HandleGetPresets(body interface{}) (interface{}, error)
- func (s *Server) HandleGetProfiles(body interface{}) (interface{}, error)
- func (s *Server) HandleGetServices(body interface{}) (interface{}, error)
- func (s *Server) HandleGetSnapshotURI(body interface{}) (interface{}, error)
- func (s *Server) HandleGetStatus(body interface{}) (interface{}, error)
- func (s *Server) HandleGetStreamURI(body interface{}) (interface{}, error)
- func (s *Server) HandleGetSystemDateAndTime(body interface{}) (interface{}, error)
- func (s *Server) HandleGetVideoSources(body interface{}) (interface{}, error)
- func (s *Server) HandleGotoPreset(body interface{}) (interface{}, error)
- func (s *Server) HandleMove(body interface{}) (interface{}, error)
- func (s *Server) HandleRelativeMove(body interface{}) (interface{}, error)
- func (s *Server) HandleSetImagingSettings(body interface{}) (interface{}, error)
- func (s *Server) HandleStop(body interface{}) (interface{}, error)
- func (s *Server) HandleSystemReboot(body interface{}) (interface{}, error)
- func (s *Server) ListProfiles() []ProfileConfig
- func (s *Server) ServerInfo() string
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) UpdateStreamURI(profileToken, uri string) error
- type Service
- type SetImagingSettingsRequest
- type SetImagingSettingsResponse
- type SetPresetRequest
- type SetPresetResponse
- type SnapshotConfig
- type Space1DDescription
- type Space2DDescription
- type StopRequest
- type StopResponse
- type StreamConfig
- type StreamingCapabilities
- type SystemCapabilities
- type SystemRebootResponse
- type Vector1D
- type Vector2D
- type Version
- type VideoAnalyticsConfiguration
- type VideoEncoderConfig
- type VideoEncoderConfiguration
- type VideoRateControl
- type VideoResolution
- type VideoSource
- type VideoSourceConfig
- type VideoSourceConfiguration
- type WDRSettings
- type WhiteBalanceOptions
- type WhiteBalanceSettings
- type WhiteBalanceSettings20
- type WideDynamicRangeOptions
- type WideDynamicRangeSettings
- type ZoomLimits
Constants ¶
This section is empty.
Variables ¶
var ( // ErrVideoSourceNotFound is returned when a video source is not found. ErrVideoSourceNotFound = errors.New("video source not found") // ErrProfileNotFound is returned when a profile is not found. ErrProfileNotFound = errors.New("profile not found") // ErrSnapshotNotSupported is returned when snapshot is not supported for a profile. ErrSnapshotNotSupported = errors.New("snapshot not supported for profile") // ErrPTZNotSupported is returned when PTZ is not supported for a profile. ErrPTZNotSupported = errors.New("PTZ not supported for profile") // ErrPresetNotFound is returned when a preset is not found. ErrPresetNotFound = errors.New("preset not found") )
Functions ¶
This section is empty.
Types ¶
type AbsoluteFocus ¶
type AbsoluteFocus struct {
Position float64 `xml:"Position"`
Speed *float64 `xml:"Speed,omitempty"`
}
AbsoluteFocus represents absolute focus.
type AbsoluteMoveRequest ¶
type AbsoluteMoveRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl AbsoluteMove"`
ProfileToken string `xml:"ProfileToken"`
Position PTZVector `xml:"Position"`
Speed PTZVector `xml:"Speed,omitempty"`
}
AbsoluteMoveRequest represents AbsoluteMove request.
type AbsoluteMoveResponse ¶
type AbsoluteMoveResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl AbsoluteMoveResponse"`
}
AbsoluteMoveResponse represents AbsoluteMove response.
type AnalyticsCapabilities ¶
type AnalyticsCapabilities struct {
XAddr string `xml:"XAddr"`
RuleSupport bool `xml:"RuleSupport,attr"`
AnalyticsModuleSupport bool `xml:"AnalyticsModuleSupport,attr"`
}
AnalyticsCapabilities represents analytics service capabilities.
type AudioEncoderConfig ¶
type AudioEncoderConfig struct {
Encoding string // G711, G726, AAC
Bitrate int // Bitrate in kbps
SampleRate int // Sample rate in Hz
}
AudioEncoderConfig represents audio encoder configuration.
type AudioEncoderConfiguration ¶
type AudioEncoderConfiguration struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
Encoding string `xml:"Encoding"`
Bitrate int `xml:"Bitrate"`
SampleRate int `xml:"SampleRate"`
Multicast *MulticastConfiguration `xml:"Multicast,omitempty"`
SessionTimeout string `xml:"SessionTimeout"`
}
AudioEncoderConfiguration represents audio encoder configuration.
type AudioSourceConfig ¶
type AudioSourceConfig struct {
Token string // Audio source token
Name string // Audio source name
SampleRate int // Sample rate in Hz (e.g., 8000, 16000, 48000)
Bitrate int // Bitrate in kbps
}
AudioSourceConfig represents audio source configuration.
type AudioSourceConfiguration ¶
type AudioSourceConfiguration struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
SourceToken string `xml:"SourceToken"`
}
AudioSourceConfiguration represents audio source configuration.
type BacklightCompensation ¶
BacklightCompensation represents backlight compensation settings.
type BacklightCompensationOptions ¶
type BacklightCompensationOptions struct {
Mode []string `xml:"Mode"`
Level *FloatRange `xml:"Level,omitempty"`
}
BacklightCompensationOptions represents backlight compensation options.
type BacklightCompensationSettings ¶
type BacklightCompensationSettings struct {
Mode string `xml:"Mode"`
Level *float64 `xml:"Level,omitempty"`
}
BacklightCompensationSettings represents backlight compensation settings.
type Capabilities ¶
type Capabilities struct {
Analytics *AnalyticsCapabilities `xml:"Analytics,omitempty"`
Device *DeviceCapabilities `xml:"Device"`
Events *EventCapabilities `xml:"Events,omitempty"`
Imaging *ImagingCapabilities `xml:"Imaging,omitempty"`
Media *MediaCapabilities `xml:"Media"`
PTZ *PTZCapabilities `xml:"PTZ,omitempty"`
}
Capabilities represents device capabilities.
type Config ¶
type Config struct {
// Server settings
Host string // Bind address (e.g., "0.0.0.0")
Port int // Server port (default: 8080)
BasePath string // Base path for services (default: "/onvif")
Timeout time.Duration // Request timeout
// Device information
DeviceInfo DeviceInfo
// Authentication
Username string
Password string
// Camera profiles (supports multi-lens cameras)
Profiles []ProfileConfig
// Capabilities
SupportPTZ bool
SupportImaging bool
SupportEvents bool
}
Config represents the ONVIF server configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a default server configuration with a multi-lens camera setup.
type ContinuousFocus ¶
type ContinuousFocus struct {
Speed float64 `xml:"Speed"`
}
ContinuousFocus represents continuous focus.
type ContinuousMoveRequest ¶
type ContinuousMoveRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl ContinuousMove"`
ProfileToken string `xml:"ProfileToken"`
Velocity PTZVector `xml:"Velocity"`
Timeout string `xml:"Timeout,omitempty"`
}
ContinuousMoveRequest represents ContinuousMove request.
type ContinuousMoveResponse ¶
type ContinuousMoveResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl ContinuousMoveResponse"`
}
ContinuousMoveResponse represents ContinuousMove response.
type DeviceCapabilities ¶
type DeviceCapabilities struct {
XAddr string `xml:"XAddr"`
Network *NetworkCapabilities `xml:"Network,omitempty"`
System *SystemCapabilities `xml:"System,omitempty"`
IO *IOCapabilities `xml:"IO,omitempty"`
Security *SecurityCapabilities `xml:"Security,omitempty"`
}
DeviceCapabilities represents device service capabilities.
type DeviceInfo ¶
type DeviceInfo struct {
Manufacturer string
Model string
FirmwareVersion string
SerialNumber string
HardwareID string
}
DeviceInfo contains device identification information.
type EventCapabilities ¶
type EventCapabilities struct {
XAddr string `xml:"XAddr"`
WSSubscriptionPolicySupport bool `xml:"WSSubscriptionPolicySupport,attr"`
WSPullPointSupport bool `xml:"WSPullPointSupport,attr"`
WSPausableSubscriptionSupport bool `xml:"WSPausableSubscriptionManagerInterfaceSupport,attr"`
}
EventCapabilities represents event service capabilities.
type ExposureOptions ¶
type ExposureOptions struct {
Mode []string `xml:"Mode"`
Priority []string `xml:"Priority,omitempty"`
MinExposureTime *FloatRange `xml:"MinExposureTime,omitempty"`
MaxExposureTime *FloatRange `xml:"MaxExposureTime,omitempty"`
MinGain *FloatRange `xml:"MinGain,omitempty"`
MaxGain *FloatRange `xml:"MaxGain,omitempty"`
MinIris *FloatRange `xml:"MinIris,omitempty"`
MaxIris *FloatRange `xml:"MaxIris,omitempty"`
ExposureTime *FloatRange `xml:"ExposureTime,omitempty"`
Gain *FloatRange `xml:"Gain,omitempty"`
Iris *FloatRange `xml:"Iris,omitempty"`
}
ExposureOptions represents exposure options.
type ExposureSettings ¶
type ExposureSettings struct {
Mode string // AUTO, MANUAL
Priority string // LowNoise, FrameRate
MinExposure float64
MaxExposure float64
MinGain float64
MaxGain float64
ExposureTime float64
Gain float64
}
ExposureSettings represents exposure settings.
type ExposureSettings20 ¶
type ExposureSettings20 struct {
Mode string `xml:"Mode"`
Priority *string `xml:"Priority,omitempty"`
Window *Rectangle `xml:"Window,omitempty"`
MinExposureTime *float64 `xml:"MinExposureTime,omitempty"`
MaxExposureTime *float64 `xml:"MaxExposureTime,omitempty"`
MinGain *float64 `xml:"MinGain,omitempty"`
MaxGain *float64 `xml:"MaxGain,omitempty"`
MinIris *float64 `xml:"MinIris,omitempty"`
MaxIris *float64 `xml:"MaxIris,omitempty"`
ExposureTime *float64 `xml:"ExposureTime,omitempty"`
Gain *float64 `xml:"Gain,omitempty"`
Iris *float64 `xml:"Iris,omitempty"`
}
ExposureSettings20 represents exposure settings for ONVIF 2.0.
type FloatRange ¶
FloatRange represents a float range.
type FocusConfiguration20 ¶
type FocusConfiguration20 struct {
AutoFocusMode string `xml:"AutoFocusMode"`
DefaultSpeed *float64 `xml:"DefaultSpeed,omitempty"`
NearLimit *float64 `xml:"NearLimit,omitempty"`
FarLimit *float64 `xml:"FarLimit,omitempty"`
}
FocusConfiguration20 represents focus configuration for ONVIF 2.0.
type FocusMove ¶
type FocusMove struct {
Absolute *AbsoluteFocus `xml:"Absolute,omitempty"`
Relative *RelativeFocus `xml:"Relative,omitempty"`
Continuous *ContinuousFocus `xml:"Continuous,omitempty"`
}
FocusMove represents focus move parameters.
type FocusOptions ¶
type FocusOptions struct {
AutoFocusModes []string `xml:"AutoFocusModes"`
DefaultSpeed *FloatRange `xml:"DefaultSpeed,omitempty"`
NearLimit *FloatRange `xml:"NearLimit,omitempty"`
FarLimit *FloatRange `xml:"FarLimit,omitempty"`
}
FocusOptions represents focus options.
type FocusSettings ¶
type FocusSettings struct {
AutoFocusMode string // AUTO, MANUAL
DefaultSpeed float64
NearLimit float64
FarLimit float64
CurrentPos float64
}
FocusSettings represents focus settings.
type GetCapabilitiesResponse ¶
type GetCapabilitiesResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetCapabilitiesResponse"`
Capabilities *Capabilities `xml:"Capabilities"`
}
GetCapabilitiesResponse represents GetCapabilities response.
type GetConfigurationsResponse ¶
type GetConfigurationsResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetConfigurationsResponse"`
PTZConfiguration []PTZConfigurationExt `xml:"PTZConfiguration"`
}
GetConfigurationsResponse represents GetConfigurations response.
type GetDeviceInformationResponse ¶
type GetDeviceInformationResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetDeviceInformationResponse"`
Manufacturer string `xml:"Manufacturer"`
Model string `xml:"Model"`
FirmwareVersion string `xml:"FirmwareVersion"`
SerialNumber string `xml:"SerialNumber"`
HardwareID string `xml:"HardwareId"`
}
GetDeviceInformationResponse represents GetDeviceInformation response.
type GetImagingSettingsRequest ¶
type GetImagingSettingsRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl GetImagingSettings"`
VideoSourceToken string `xml:"VideoSourceToken"`
}
GetImagingSettingsRequest represents GetImagingSettings request.
type GetImagingSettingsResponse ¶
type GetImagingSettingsResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl GetImagingSettingsResponse"`
ImagingSettings *ImagingSettings `xml:"ImagingSettings"`
}
GetImagingSettingsResponse represents GetImagingSettings response.
type GetOptionsRequest ¶
type GetOptionsRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl GetOptions"`
VideoSourceToken string `xml:"VideoSourceToken"`
}
GetOptionsRequest represents GetOptions request.
type GetOptionsResponse ¶
type GetOptionsResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl GetOptionsResponse"`
ImagingOptions *ImagingOptions `xml:"ImagingOptions"`
}
GetOptionsResponse represents GetOptions response.
type GetPresetsRequest ¶
type GetPresetsRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetPresets"`
ProfileToken string `xml:"ProfileToken"`
}
GetPresetsRequest represents GetPresets request.
type GetPresetsResponse ¶
type GetPresetsResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetPresetsResponse"`
Preset []PTZPreset `xml:"Preset"`
}
GetPresetsResponse represents GetPresets response.
type GetProfilesResponse ¶
type GetProfilesResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetProfilesResponse"`
Profiles []MediaProfile `xml:"Profiles"`
}
GetProfilesResponse represents GetProfiles response.
type GetServicesResponse ¶
type GetServicesResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetServicesResponse"`
Service []Service `xml:"Service"`
}
GetServicesResponse represents GetServices response.
type GetSnapshotURIResponse ¶
type GetSnapshotURIResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetSnapshotURIResponse"`
MediaURI MediaURI `xml:"MediaUri"`
}
GetSnapshotURIResponse represents GetSnapshotURI response.
type GetStatusRequest ¶
type GetStatusRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetStatus"`
ProfileToken string `xml:"ProfileToken"`
}
GetStatusRequest represents GetStatus request.
type GetStatusResponse ¶
type GetStatusResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetStatusResponse"`
PTZStatus *PTZStatus `xml:"PTZStatus"`
}
GetStatusResponse represents GetStatus response.
type GetStreamURIResponse ¶
type GetStreamURIResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetStreamURIResponse"`
MediaURI MediaURI `xml:"MediaUri"`
}
GetStreamURIResponse represents GetStreamURI response.
type GetVideoSourcesResponse ¶
type GetVideoSourcesResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetVideoSourcesResponse"`
VideoSources []VideoSource `xml:"VideoSources"`
}
GetVideoSourcesResponse represents GetVideoSources response.
type GotoPresetRequest ¶
type GotoPresetRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GotoPreset"`
ProfileToken string `xml:"ProfileToken"`
PresetToken string `xml:"PresetToken"`
Speed PTZVector `xml:"Speed,omitempty"`
}
GotoPresetRequest represents GotoPreset request.
type GotoPresetResponse ¶
type GotoPresetResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GotoPresetResponse"`
}
GotoPresetResponse represents GotoPreset response.
type H264Configuration ¶
type H264Configuration struct {
GovLength int `xml:"GovLength"`
H264Profile string `xml:"H264Profile"`
}
H264Configuration represents H264 configuration.
type IOCapabilities ¶
type IOCapabilities struct {
InputConnectors int `xml:"InputConnectors,attr"`
RelayOutputs int `xml:"RelayOutputs,attr"`
}
IOCapabilities represents I/O capabilities.
type IPAddress ¶
type IPAddress struct {
Type string `xml:"Type"`
IPv4Address string `xml:"IPv4Address,omitempty"`
IPv6Address string `xml:"IPv6Address,omitempty"`
}
IPAddress represents an IP address.
type ImagingCapabilities ¶
type ImagingCapabilities struct {
XAddr string `xml:"XAddr"`
}
ImagingCapabilities represents imaging service capabilities.
type ImagingOptions ¶
type ImagingOptions struct {
BacklightCompensation *BacklightCompensationOptions `xml:"BacklightCompensation,omitempty"`
Brightness *FloatRange `xml:"Brightness,omitempty"`
ColorSaturation *FloatRange `xml:"ColorSaturation,omitempty"`
Contrast *FloatRange `xml:"Contrast,omitempty"`
Exposure *ExposureOptions `xml:"Exposure,omitempty"`
Focus *FocusOptions `xml:"Focus,omitempty"`
IrCutFilterModes []string `xml:"IrCutFilterModes,omitempty"`
Sharpness *FloatRange `xml:"Sharpness,omitempty"`
WideDynamicRange *WideDynamicRangeOptions `xml:"WideDynamicRange,omitempty"`
WhiteBalance *WhiteBalanceOptions `xml:"WhiteBalance,omitempty"`
}
ImagingOptions represents imaging options/capabilities.
type ImagingSettings ¶
type ImagingSettings struct {
BacklightCompensation *BacklightCompensationSettings `xml:"BacklightCompensation,omitempty"`
Brightness *float64 `xml:"Brightness,omitempty"`
ColorSaturation *float64 `xml:"ColorSaturation,omitempty"`
Contrast *float64 `xml:"Contrast,omitempty"`
Exposure *ExposureSettings20 `xml:"Exposure,omitempty"`
Focus *FocusConfiguration20 `xml:"Focus,omitempty"`
IrCutFilter *string `xml:"IrCutFilter,omitempty"`
Sharpness *float64 `xml:"Sharpness,omitempty"`
WideDynamicRange *WideDynamicRangeSettings `xml:"WideDynamicRange,omitempty"`
WhiteBalance *WhiteBalanceSettings20 `xml:"WhiteBalance,omitempty"`
}
ImagingSettings represents imaging settings.
type ImagingState ¶
type ImagingState struct {
Brightness float64
Contrast float64
Saturation float64
Sharpness float64
BacklightComp BacklightCompensation
Exposure ExposureSettings
Focus FocusSettings
WhiteBalance WhiteBalanceSettings
WideDynamicRange WDRSettings
IrCutFilter string // ON, OFF, AUTO
}
ImagingState represents the current imaging settings state.
type IntRectangle ¶
type IntRectangle struct {
X int `xml:"x,attr"`
Y int `xml:"y,attr"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
}
IntRectangle represents a rectangle with integer coordinates.
type MediaCapabilities ¶
type MediaCapabilities struct {
XAddr string `xml:"XAddr"`
StreamingCapabilities *StreamingCapabilities `xml:"StreamingCapabilities"`
}
MediaCapabilities represents media service capabilities.
type MediaProfile ¶
type MediaProfile struct {
Token string `xml:"token,attr"`
Fixed bool `xml:"fixed,attr"`
Name string `xml:"Name"`
VideoSourceConfiguration *VideoSourceConfiguration `xml:"VideoSourceConfiguration"`
AudioSourceConfiguration *AudioSourceConfiguration `xml:"AudioSourceConfiguration,omitempty"`
VideoEncoderConfiguration *VideoEncoderConfiguration `xml:"VideoEncoderConfiguration"`
AudioEncoderConfiguration *AudioEncoderConfiguration `xml:"AudioEncoderConfiguration,omitempty"`
VideoAnalyticsConfiguration *VideoAnalyticsConfiguration `xml:"VideoAnalyticsConfiguration,omitempty"`
PTZConfiguration *PTZConfiguration `xml:"PTZConfiguration,omitempty"`
MetadataConfiguration *MetadataConfiguration `xml:"MetadataConfiguration,omitempty"`
}
MediaProfile represents a media profile.
type MediaURI ¶ added in v1.1.4
type MediaURI struct {
URI string `xml:"Uri"`
InvalidAfterConnect bool `xml:"InvalidAfterConnect"`
InvalidAfterReboot bool `xml:"InvalidAfterReboot"`
Timeout string `xml:"Timeout"`
}
MediaURI represents a media URI.
type MetadataConfiguration ¶
type MetadataConfiguration struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
SessionTimeout string `xml:"SessionTimeout"`
}
MetadataConfiguration represents metadata configuration.
type MoveRequest ¶
type MoveRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl Move"`
VideoSourceToken string `xml:"VideoSourceToken"`
Focus *FocusMove `xml:"Focus"`
}
MoveRequest represents Move (focus) request.
type MoveResponse ¶
type MoveResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl MoveResponse"`
}
MoveResponse represents Move response.
type MulticastConfiguration ¶
type MulticastConfiguration struct {
Address IPAddress `xml:"Address"`
Port int `xml:"Port"`
TTL int `xml:"TTL"`
AutoStart bool `xml:"AutoStart"`
}
MulticastConfiguration represents multicast configuration.
type NetworkCapabilities ¶
type NetworkCapabilities struct {
IPFilter bool `xml:"IPFilter,attr"`
ZeroConfiguration bool `xml:"ZeroConfiguration,attr"`
IPVersion6 bool `xml:"IPVersion6,attr"`
DynDNS bool `xml:"DynDNS,attr"`
}
NetworkCapabilities represents network capabilities.
type PTZCapabilities ¶
type PTZCapabilities struct {
XAddr string `xml:"XAddr"`
}
PTZCapabilities represents PTZ service capabilities.
type PTZConfig ¶
type PTZConfig struct {
NodeToken string // PTZ node token
PanRange Range // Pan range in degrees
TiltRange Range // Tilt range in degrees
ZoomRange Range // Zoom range
DefaultSpeed PTZSpeed // Default speed
SupportsContinuous bool // Supports continuous move
SupportsAbsolute bool // Supports absolute move
SupportsRelative bool // Supports relative move
Presets []Preset // Predefined presets
}
PTZConfig represents PTZ configuration.
type PTZConfiguration ¶
type PTZConfiguration struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
NodeToken string `xml:"NodeToken"`
}
PTZConfiguration represents PTZ configuration.
type PTZConfigurationExt ¶
type PTZConfigurationExt struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
NodeToken string `xml:"NodeToken"`
PanTiltLimits *PanTiltLimits `xml:"PanTiltLimits,omitempty"`
ZoomLimits *ZoomLimits `xml:"ZoomLimits,omitempty"`
}
PTZConfigurationExt represents PTZ configuration with extensions.
type PTZMoveStatus ¶
type PTZMoveStatus struct {
PanTilt string `xml:"PanTilt,omitempty"`
Zoom string `xml:"Zoom,omitempty"`
}
PTZMoveStatus represents PTZ movement status.
type PTZPosition ¶
type PTZPosition struct {
Pan float64 // Pan position
Tilt float64 // Tilt position
Zoom float64 // Zoom position
}
PTZPosition represents PTZ position.
type PTZPreset ¶
type PTZPreset struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
PTZPosition *PTZVector `xml:"PTZPosition,omitempty"`
}
PTZPreset represents a PTZ preset.
type PTZSpeed ¶
type PTZSpeed struct {
Pan float64 // Pan speed (-1.0 to 1.0)
Tilt float64 // Tilt speed (-1.0 to 1.0)
Zoom float64 // Zoom speed (-1.0 to 1.0)
}
PTZSpeed represents PTZ movement speed.
type PTZState ¶
type PTZState struct {
Position PTZPosition
Moving bool
PanMoving bool
TiltMoving bool
ZoomMoving bool
LastUpdate time.Time
}
PTZState represents the current PTZ state.
type PTZStatus ¶
type PTZStatus struct {
Position PTZVector `xml:"Position"`
MoveStatus PTZMoveStatus `xml:"MoveStatus"`
UTCTime string `xml:"UtcTime"`
}
PTZStatus represents PTZ status.
type PTZVector ¶
type PTZVector struct {
PanTilt *Vector2D `xml:"PanTilt,omitempty"`
Zoom *Vector1D `xml:"Zoom,omitempty"`
}
PTZVector represents PTZ position/velocity.
type PanTiltLimits ¶
type PanTiltLimits struct {
Range Space2DDescription `xml:"Range"`
}
PanTiltLimits represents pan/tilt limits.
type Preset ¶
type Preset struct {
Token string // Preset token
Name string // Preset name
Position PTZPosition // Position
}
Preset represents a PTZ preset position.
type ProfileConfig ¶
type ProfileConfig struct {
Token string // Profile token (unique identifier)
Name string // Profile name
VideoSource VideoSourceConfig // Video source configuration
AudioSource *AudioSourceConfig // Audio source configuration (optional)
VideoEncoder VideoEncoderConfig // Video encoder configuration
AudioEncoder *AudioEncoderConfig // Audio encoder configuration (optional)
PTZ *PTZConfig // PTZ configuration (optional)
Snapshot SnapshotConfig // Snapshot configuration
}
ProfileConfig represents a camera profile configuration.
func (*ProfileConfig) ToONVIFProfile ¶
func (p *ProfileConfig) ToONVIFProfile() *onvif.Profile
ToONVIFProfile converts a ProfileConfig to an ONVIF Profile.
type Rectangle ¶
type Rectangle struct {
Bottom float64 `xml:"bottom,attr"`
Top float64 `xml:"top,attr"`
Right float64 `xml:"right,attr"`
Left float64 `xml:"left,attr"`
}
Rectangle represents a rectangle.
type RelativeFocus ¶
type RelativeFocus struct {
Distance float64 `xml:"Distance"`
Speed *float64 `xml:"Speed,omitempty"`
}
RelativeFocus represents relative focus.
type RelativeMoveRequest ¶
type RelativeMoveRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl RelativeMove"`
ProfileToken string `xml:"ProfileToken"`
Translation PTZVector `xml:"Translation"`
Speed PTZVector `xml:"Speed,omitempty"`
}
RelativeMoveRequest represents RelativeMove request.
type RelativeMoveResponse ¶
type RelativeMoveResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl RelativeMoveResponse"`
}
RelativeMoveResponse represents RelativeMove response.
type Resolution ¶
Resolution represents video resolution.
type SecurityCapabilities ¶
type SecurityCapabilities struct {
TLS11 bool `xml:"TLS1.1,attr"`
TLS12 bool `xml:"TLS1.2,attr"`
OnboardKeyGeneration bool `xml:"OnboardKeyGeneration,attr"`
AccessPolicyConfig bool `xml:"AccessPolicyConfig,attr"`
X509Token bool `xml:"X.509Token,attr"`
SAMLToken bool `xml:"SAMLToken,attr"`
KerberosToken bool `xml:"KerberosToken,attr"`
RELToken bool `xml:"RELToken,attr"`
}
SecurityCapabilities represents security capabilities.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the ONVIF server.
func (*Server) GetImagingState ¶
func (s *Server) GetImagingState(videoSourceToken string) (*ImagingState, bool)
GetImagingState returns the current imaging state for a video source.
func (*Server) GetPTZState ¶
GetPTZState returns the current PTZ state for a profile.
func (*Server) GetStreamConfig ¶
func (s *Server) GetStreamConfig(profileToken string) (*StreamConfig, bool)
GetStreamConfig returns the stream configuration for a profile.
func (*Server) HandleAbsoluteMove ¶
HandleAbsoluteMove handles AbsoluteMove request.
func (*Server) HandleContinuousMove ¶
HandleContinuousMove handles ContinuousMove request.
func (*Server) HandleGetCapabilities ¶
HandleGetCapabilities handles GetCapabilities request.
func (*Server) HandleGetDeviceInformation ¶
HandleGetDeviceInformation handles GetDeviceInformation request.
func (*Server) HandleGetImagingSettings ¶
HandleGetImagingSettings handles GetImagingSettings request.
func (*Server) HandleGetOptions ¶
HandleGetOptions handles GetOptions request.
func (*Server) HandleGetPresets ¶
HandleGetPresets handles GetPresets request.
func (*Server) HandleGetProfiles ¶
HandleGetProfiles handles GetProfiles request.
func (*Server) HandleGetServices ¶
HandleGetServices handles GetServices request.
func (*Server) HandleGetSnapshotURI ¶
HandleGetSnapshotURI handles GetSnapshotURI request.
func (*Server) HandleGetStatus ¶
HandleGetStatus handles GetStatus request.
func (*Server) HandleGetStreamURI ¶
HandleGetStreamURI handles GetStreamURI request.
func (*Server) HandleGetSystemDateAndTime ¶
HandleGetSystemDateAndTime handles GetSystemDateAndTime request.
func (*Server) HandleGetVideoSources ¶
HandleGetVideoSources handles GetVideoSources request.
func (*Server) HandleGotoPreset ¶
HandleGotoPreset handles GotoPreset request.
func (*Server) HandleMove ¶
HandleMove handles Move (focus) request.
func (*Server) HandleRelativeMove ¶
HandleRelativeMove handles RelativeMove request.
func (*Server) HandleSetImagingSettings ¶
HandleSetImagingSettings handles SetImagingSettings request.
func (*Server) HandleStop ¶
HandleStop handles Stop request.
func (*Server) HandleSystemReboot ¶
HandleSystemReboot handles SystemReboot request.
func (*Server) ListProfiles ¶
func (s *Server) ListProfiles() []ProfileConfig
ListProfiles returns all configured profiles.
func (*Server) ServerInfo ¶
ServerInfo returns human-readable server information.
func (*Server) UpdateStreamURI ¶
UpdateStreamURI updates the RTSP URI for a profile.
type Service ¶
type Service struct {
Namespace string `xml:"Namespace"`
XAddr string `xml:"XAddr"`
Version Version `xml:"Version"`
}
Service represents a service.
type SetImagingSettingsRequest ¶
type SetImagingSettingsRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl SetImagingSettings"`
VideoSourceToken string `xml:"VideoSourceToken"`
ImagingSettings *ImagingSettings `xml:"ImagingSettings"`
ForcePersistence bool `xml:"ForcePersistence,omitempty"`
}
SetImagingSettingsRequest represents SetImagingSettings request.
type SetImagingSettingsResponse ¶
type SetImagingSettingsResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl SetImagingSettingsResponse"`
}
SetImagingSettingsResponse represents SetImagingSettings response.
type SetPresetRequest ¶
type SetPresetRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl SetPreset"`
ProfileToken string `xml:"ProfileToken"`
PresetName string `xml:"PresetName,omitempty"`
PresetToken string `xml:"PresetToken,omitempty"`
}
SetPresetRequest represents SetPreset request.
type SetPresetResponse ¶
type SetPresetResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl SetPresetResponse"`
PresetToken string `xml:"PresetToken"`
}
SetPresetResponse represents SetPreset response.
type SnapshotConfig ¶
type SnapshotConfig struct {
Enabled bool // Whether snapshots are supported
Resolution Resolution // Snapshot resolution
Quality float64 // JPEG quality (0-100)
}
SnapshotConfig represents snapshot configuration.
type Space1DDescription ¶
type Space1DDescription struct {
URI string `xml:"URI"`
XRange FloatRange `xml:"XRange"`
}
Space1DDescription represents 1D space description.
type Space2DDescription ¶
type Space2DDescription struct {
URI string `xml:"URI"`
XRange FloatRange `xml:"XRange"`
YRange FloatRange `xml:"YRange"`
}
Space2DDescription represents 2D space description.
type StopRequest ¶
type StopRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl Stop"`
ProfileToken string `xml:"ProfileToken"`
PanTilt bool `xml:"PanTilt,omitempty"`
Zoom bool `xml:"Zoom,omitempty"`
}
StopRequest represents Stop request.
type StopResponse ¶
type StopResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl StopResponse"`
}
StopResponse represents Stop response.
type StreamConfig ¶
type StreamConfig struct {
ProfileToken string // Associated profile token
RTSPPath string // RTSP path (e.g., "/stream1")
StreamURI string // Full RTSP URI
}
StreamConfig represents an RTSP stream configuration.
type StreamingCapabilities ¶
type StreamingCapabilities struct {
RTPMulticast bool `xml:"RTPMulticast,attr"`
RTPTCP bool `xml:"RTP_TCP,attr"`
RTPRTSPTCP bool `xml:"RTP_RTSP_TCP,attr"`
}
StreamingCapabilities represents streaming capabilities.
type SystemCapabilities ¶
type SystemCapabilities struct {
DiscoveryResolve bool `xml:"DiscoveryResolve,attr"`
DiscoveryBye bool `xml:"DiscoveryBye,attr"`
RemoteDiscovery bool `xml:"RemoteDiscovery,attr"`
SystemBackup bool `xml:"SystemBackup,attr"`
SystemLogging bool `xml:"SystemLogging,attr"`
FirmwareUpgrade bool `xml:"FirmwareUpgrade,attr"`
}
SystemCapabilities represents system capabilities.
type SystemRebootResponse ¶
type SystemRebootResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl SystemRebootResponse"`
Message string `xml:"Message"`
}
SystemRebootResponse represents SystemReboot response.
type Vector2D ¶
type Vector2D struct {
X float64 `xml:"x,attr"`
Y float64 `xml:"y,attr"`
Space string `xml:"space,attr,omitempty"`
}
Vector2D represents a 2D vector.
type VideoAnalyticsConfiguration ¶
type VideoAnalyticsConfiguration struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
}
VideoAnalyticsConfiguration represents video analytics configuration.
type VideoEncoderConfig ¶
type VideoEncoderConfig struct {
Encoding string // JPEG, H264, H265, MPEG4
Resolution Resolution // Video resolution
Quality float64 // Quality (0-100)
Framerate int // Frames per second
Bitrate int // Bitrate in kbps
GovLength int // GOP length
}
VideoEncoderConfig represents video encoder configuration.
type VideoEncoderConfiguration ¶
type VideoEncoderConfiguration struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
Encoding string `xml:"Encoding"`
Resolution VideoResolution `xml:"Resolution"`
Quality float64 `xml:"Quality"`
RateControl *VideoRateControl `xml:"RateControl,omitempty"`
H264 *H264Configuration `xml:"H264,omitempty"`
Multicast *MulticastConfiguration `xml:"Multicast,omitempty"`
SessionTimeout string `xml:"SessionTimeout"`
}
VideoEncoderConfiguration represents video encoder configuration.
type VideoRateControl ¶
type VideoRateControl struct {
FrameRateLimit int `xml:"FrameRateLimit"`
EncodingInterval int `xml:"EncodingInterval"`
BitrateLimit int `xml:"BitrateLimit"`
}
VideoRateControl represents video rate control.
type VideoResolution ¶
VideoResolution represents video resolution.
type VideoSource ¶
type VideoSource struct {
Token string `xml:"token,attr"`
Framerate float64 `xml:"Framerate"`
Resolution VideoResolution `xml:"Resolution"`
}
VideoSource represents a video source.
type VideoSourceConfig ¶
type VideoSourceConfig struct {
Token string // Video source token
Name string // Video source name
Resolution Resolution
Framerate int
Bounds Bounds
}
VideoSourceConfig represents video source configuration.
type VideoSourceConfiguration ¶
type VideoSourceConfiguration struct {
Token string `xml:"token,attr"`
Name string `xml:"Name"`
UseCount int `xml:"UseCount"`
SourceToken string `xml:"SourceToken"`
Bounds IntRectangle `xml:"Bounds"`
}
VideoSourceConfiguration represents video source configuration.
type WDRSettings ¶
WDRSettings represents wide dynamic range settings.
type WhiteBalanceOptions ¶
type WhiteBalanceOptions struct {
Mode []string `xml:"Mode"`
YrGain *FloatRange `xml:"YrGain,omitempty"`
YbGain *FloatRange `xml:"YbGain,omitempty"`
}
WhiteBalanceOptions represents white balance options.
type WhiteBalanceSettings ¶
WhiteBalanceSettings represents white balance settings.
type WhiteBalanceSettings20 ¶
type WhiteBalanceSettings20 struct {
Mode string `xml:"Mode"`
CrGain *float64 `xml:"CrGain,omitempty"`
CbGain *float64 `xml:"CbGain,omitempty"`
}
WhiteBalanceSettings20 represents white balance settings for ONVIF 2.0.
type WideDynamicRangeOptions ¶
type WideDynamicRangeOptions struct {
Mode []string `xml:"Mode"`
Level *FloatRange `xml:"Level,omitempty"`
}
WideDynamicRangeOptions represents WDR options.
type WideDynamicRangeSettings ¶
type WideDynamicRangeSettings struct {
Mode string `xml:"Mode"`
Level *float64 `xml:"Level,omitempty"`
}
WideDynamicRangeSettings represents WDR settings.
type ZoomLimits ¶
type ZoomLimits struct {
Range Space1DDescription `xml:"Range"`
}
ZoomLimits represents zoom limits.