feat: add comprehensive ONVIF test reports and enhance documentation
- Introduced CAMERA_TEST_REPORT.md and COMPREHENSIVE_TEST_SUMMARY.md to document testing results for the Bosch FLEXIDOME indoor 5100i IR camera. - Added detailed analysis of ONVIF Media Service operations and implementation status in MEDIA_OPERATIONS_ANALYSIS.md and MEDIA_WSDL_OPERATIONS_ANALYSIS.md. - Updated implementation status documentation to reflect the completion of all 79 operations in the ONVIF Media Service. - Enhanced existing comments and documentation across various files for better clarity and consistency.
This commit is contained in:
+28
-28
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/0x524a/onvif-go"
|
||||
)
|
||||
|
||||
// Config represents the ONVIF server configuration
|
||||
// Config represents the ONVIF server configuration.
|
||||
type Config struct {
|
||||
// Server settings
|
||||
Host string // Bind address (e.g., "0.0.0.0")
|
||||
@@ -31,7 +31,7 @@ type Config struct {
|
||||
SupportEvents bool
|
||||
}
|
||||
|
||||
// DeviceInfo contains device identification information
|
||||
// DeviceInfo contains device identification information.
|
||||
type DeviceInfo struct {
|
||||
Manufacturer string
|
||||
Model string
|
||||
@@ -40,7 +40,7 @@ type DeviceInfo struct {
|
||||
HardwareID string
|
||||
}
|
||||
|
||||
// ProfileConfig represents a camera profile configuration
|
||||
// ProfileConfig represents a camera profile configuration.
|
||||
type ProfileConfig struct {
|
||||
Token string // Profile token (unique identifier)
|
||||
Name string // Profile name
|
||||
@@ -52,7 +52,7 @@ type ProfileConfig struct {
|
||||
Snapshot SnapshotConfig // Snapshot configuration
|
||||
}
|
||||
|
||||
// VideoSourceConfig represents video source configuration
|
||||
// VideoSourceConfig represents video source configuration.
|
||||
type VideoSourceConfig struct {
|
||||
Token string // Video source token
|
||||
Name string // Video source name
|
||||
@@ -61,7 +61,7 @@ type VideoSourceConfig struct {
|
||||
Bounds Bounds
|
||||
}
|
||||
|
||||
// AudioSourceConfig represents audio source configuration
|
||||
// AudioSourceConfig represents audio source configuration.
|
||||
type AudioSourceConfig struct {
|
||||
Token string // Audio source token
|
||||
Name string // Audio source name
|
||||
@@ -69,7 +69,7 @@ type AudioSourceConfig struct {
|
||||
Bitrate int // Bitrate in kbps
|
||||
}
|
||||
|
||||
// VideoEncoderConfig represents video encoder configuration
|
||||
// VideoEncoderConfig represents video encoder configuration.
|
||||
type VideoEncoderConfig struct {
|
||||
Encoding string // JPEG, H264, H265, MPEG4
|
||||
Resolution Resolution // Video resolution
|
||||
@@ -79,14 +79,14 @@ type VideoEncoderConfig struct {
|
||||
GovLength int // GOP length
|
||||
}
|
||||
|
||||
// AudioEncoderConfig represents audio encoder configuration
|
||||
// AudioEncoderConfig represents audio encoder configuration.
|
||||
type AudioEncoderConfig struct {
|
||||
Encoding string // G711, G726, AAC
|
||||
Bitrate int // Bitrate in kbps
|
||||
SampleRate int // Sample rate in Hz
|
||||
}
|
||||
|
||||
// PTZConfig represents PTZ configuration
|
||||
// PTZConfig represents PTZ configuration.
|
||||
type PTZConfig struct {
|
||||
NodeToken string // PTZ node token
|
||||
PanRange Range // Pan range in degrees
|
||||
@@ -99,20 +99,20 @@ type PTZConfig struct {
|
||||
Presets []Preset // Predefined presets
|
||||
}
|
||||
|
||||
// SnapshotConfig represents snapshot configuration
|
||||
// SnapshotConfig represents snapshot configuration.
|
||||
type SnapshotConfig struct {
|
||||
Enabled bool // Whether snapshots are supported
|
||||
Resolution Resolution // Snapshot resolution
|
||||
Quality float64 // JPEG quality (0-100)
|
||||
}
|
||||
|
||||
// Resolution represents video resolution
|
||||
// Resolution represents video resolution.
|
||||
type Resolution struct {
|
||||
Width int
|
||||
Height int
|
||||
}
|
||||
|
||||
// Bounds represents video bounds
|
||||
// Bounds represents video bounds.
|
||||
type Bounds struct {
|
||||
X int
|
||||
Y int
|
||||
@@ -120,41 +120,41 @@ type Bounds struct {
|
||||
Height int
|
||||
}
|
||||
|
||||
// Range represents a numeric range
|
||||
// Range represents a numeric range.
|
||||
type Range struct {
|
||||
Min float64
|
||||
Max float64
|
||||
}
|
||||
|
||||
// PTZSpeed represents PTZ movement speed
|
||||
// PTZSpeed represents PTZ movement speed.
|
||||
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)
|
||||
}
|
||||
|
||||
// Preset represents a PTZ preset position
|
||||
// Preset represents a PTZ preset position.
|
||||
type Preset struct {
|
||||
Token string // Preset token
|
||||
Name string // Preset name
|
||||
Position PTZPosition // Position
|
||||
}
|
||||
|
||||
// PTZPosition represents PTZ position
|
||||
// PTZPosition represents PTZ position.
|
||||
type PTZPosition struct {
|
||||
Pan float64 // Pan position
|
||||
Tilt float64 // Tilt position
|
||||
Zoom float64 // Zoom position
|
||||
}
|
||||
|
||||
// StreamConfig represents an RTSP stream configuration
|
||||
// StreamConfig represents an RTSP stream configuration.
|
||||
type StreamConfig struct {
|
||||
ProfileToken string // Associated profile token
|
||||
RTSPPath string // RTSP path (e.g., "/stream1")
|
||||
StreamURI string // Full RTSP URI
|
||||
}
|
||||
|
||||
// Server represents the ONVIF server
|
||||
// Server represents the ONVIF server.
|
||||
type Server struct {
|
||||
config *Config
|
||||
streams map[string]*StreamConfig // Profile token -> stream config
|
||||
@@ -163,7 +163,7 @@ type Server struct {
|
||||
systemTime time.Time
|
||||
}
|
||||
|
||||
// PTZState represents the current PTZ state
|
||||
// PTZState represents the current PTZ state.
|
||||
type PTZState struct {
|
||||
Position PTZPosition
|
||||
Moving bool
|
||||
@@ -173,7 +173,7 @@ type PTZState struct {
|
||||
LastUpdate time.Time
|
||||
}
|
||||
|
||||
// ImagingState represents the current imaging settings state
|
||||
// ImagingState represents the current imaging settings state.
|
||||
type ImagingState struct {
|
||||
Brightness float64
|
||||
Contrast float64
|
||||
@@ -187,13 +187,13 @@ type ImagingState struct {
|
||||
IrCutFilter string // ON, OFF, AUTO
|
||||
}
|
||||
|
||||
// BacklightCompensation represents backlight compensation settings
|
||||
// BacklightCompensation represents backlight compensation settings.
|
||||
type BacklightCompensation struct {
|
||||
Mode string // OFF, ON
|
||||
Level float64 // 0-100
|
||||
}
|
||||
|
||||
// ExposureSettings represents exposure settings
|
||||
// ExposureSettings represents exposure settings.
|
||||
type ExposureSettings struct {
|
||||
Mode string // AUTO, MANUAL
|
||||
Priority string // LowNoise, FrameRate
|
||||
@@ -205,7 +205,7 @@ type ExposureSettings struct {
|
||||
Gain float64
|
||||
}
|
||||
|
||||
// FocusSettings represents focus settings
|
||||
// FocusSettings represents focus settings.
|
||||
type FocusSettings struct {
|
||||
AutoFocusMode string // AUTO, MANUAL
|
||||
DefaultSpeed float64
|
||||
@@ -214,20 +214,20 @@ type FocusSettings struct {
|
||||
CurrentPos float64
|
||||
}
|
||||
|
||||
// WhiteBalanceSettings represents white balance settings
|
||||
// WhiteBalanceSettings represents white balance settings.
|
||||
type WhiteBalanceSettings struct {
|
||||
Mode string // AUTO, MANUAL
|
||||
CrGain float64
|
||||
CbGain float64
|
||||
}
|
||||
|
||||
// WDRSettings represents wide dynamic range settings
|
||||
// WDRSettings represents wide dynamic range settings.
|
||||
type WDRSettings struct {
|
||||
Mode string // OFF, ON
|
||||
Level float64 // 0-100
|
||||
}
|
||||
|
||||
// DefaultConfig returns a default server configuration with a multi-lens camera setup
|
||||
// DefaultConfig returns a default server configuration with a multi-lens camera setup.
|
||||
func DefaultConfig() *Config {
|
||||
return &Config{
|
||||
Host: "0.0.0.0",
|
||||
@@ -351,7 +351,7 @@ func DefaultConfig() *Config {
|
||||
}
|
||||
}
|
||||
|
||||
// ServiceEndpoints returns the service endpoint URLs
|
||||
// ServiceEndpoints returns the service endpoint URLs.
|
||||
func (c *Config) ServiceEndpoints(host string) map[string]string {
|
||||
if host == "" {
|
||||
host = c.Host
|
||||
@@ -360,7 +360,7 @@ func (c *Config) ServiceEndpoints(host string) map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := ""
|
||||
var baseURL string
|
||||
if c.Port == 80 {
|
||||
baseURL = "http://" + host + c.BasePath
|
||||
} else {
|
||||
@@ -385,7 +385,7 @@ func (c *Config) ServiceEndpoints(host string) map[string]string {
|
||||
return endpoints
|
||||
}
|
||||
|
||||
// ToONVIFProfile converts a ProfileConfig to an ONVIF Profile
|
||||
// ToONVIFProfile converts a ProfileConfig to an ONVIF Profile.
|
||||
func (p *ProfileConfig) ToONVIFProfile() *onvif.Profile {
|
||||
profile := &onvif.Profile{
|
||||
Token: p.Token,
|
||||
|
||||
Reference in New Issue
Block a user