go2rtc
go2rtc copied to clipboard
Adding onvif name and hardware in info field of onvif discovery
I like the onvif discover functinality in the add section, but I wanted some device information.
So I added code to extract the onvif://www.onvif.org/name and onvif://www.onvif.org/hardware fields from the onvif envelope and used it to populate the Info field already present in the api.Source object.
To better present this change, I created the DiscoveryDevice type in pkg/onvif/helpers.go with the fields being:
type DiscoveryDevice struct {
URL string
Name string
Hardware string
}
For clarity purposes, I also renamed the function DiscoveryStreamingURLs to DiscoveryStreamingDevices from the same package.