Documentation
¶
Index ¶
- Constants
- type Capability
- type CaptureMode
- type DataFormat
- type Device
- type Driver
- func (d *Driver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *Driver) Discover()
- func (d *Driver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) ([]*sdkModels.CommandValue, error)
- func (d *Driver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *Driver) Initialize(lc logger.LoggingClient, asyncCh chan<- *sdkModels.AsyncValues, ...) error
- func (d *Driver) RefreshExistingDevicePaths()
- func (d *Driver) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
- func (d *Driver) Stop(force bool) error
- func (d *Driver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- type EdgeXErrorWrapper
- type FFmpeg
- func (f FFmpeg) ObtainInputFps(value string) []string
- func (f FFmpeg) ObtainInputImageSize(value string) []string
- func (f FFmpeg) ObtainInputPixelFormat(value string) []string
- func (f FFmpeg) ObtainOutputAspect(value string) []string
- func (f FFmpeg) ObtainOutputFps(value string) []string
- func (f FFmpeg) ObtainOutputFrames(value string) []string
- func (f FFmpeg) ObtainOutputImageSize(value string) []string
- func (f FFmpeg) ObtainOutputVideoCodec(value string) []string
- func (f FFmpeg) ObtainOutputVideoQuality(value string) []string
- type HttpHandler
- type ImageFormat
- type StreamingCapability
- type StreamingParameters
Constants ¶
const ( Command = "command" UsbProtocol = "USB" Path = "Path" SerialNumber = "SerialNumber" CardName = "CardName" BasePath = "/dev/video" AutoStreaming = "AutoStreaming" InputIndex = "InputIndex" UrlRawQuery = "urlRawQuery" RtspServerHostName = "RtspServerHostName" DefaultRtspServerHostName = "localhost" RtspTcpPort = "RtspTcpPort" DefaultRtspTcpPort = "8554" RtspUriScheme = "rtsp" Stream = "stream" PrefixInput = "Input" PrefixOutput = "Output" // API route specific to Device Service ApiRefreshDevicePaths = "/refreshdevicepaths" // Metadata descriptions DescNotSpecified = "not specified" DescTimePerFrame = "time per frame" DescHighQuality = "high quality" // Command names MetadataDeviceCapability = "METADATA_DEVICE_CAPABILITY" MetadataCurrentVideoInput = "METADATA_CURRENT_VIDEO_INPUT" MetadataCameraStatus = "METADATA_CAMERA_STATUS" MetadataDataFormat = "METADATA_DATA_FORMAT" MetadataCroppingAbility = "METADATA_CROPPING_ABILITY" MetadataStreamingParameters = "METADATA_STREAMING_PARAMETERS" MetadataImageFormats = "METADATA_IMAGE_FORMATS" VideoStartStreaming = "VIDEO_START_STREAMING" VideoStopStreaming = "VIDEO_STOP_STREAMING" VideoStreamUri = "VIDEO_STREAM_URI" VideoStreamingStatus = "VIDEO_STREAMING_STATUS" // FFmpeg options FFmpegFrames = "-frames:d" FFmpegFps = "-r" FFmpegSize = "-s" FFmpegAspect = "-aspect" FFmpegQScale = "-qscale" FFmpegVCodec = "-vcodec" FFmpegInputFormat = "-input_format" // udev device properties UdevSerialShort = "ID_SERIAL_SHORT" UdevV4lProduct = "ID_V4L_PRODUCT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type CaptureMode ¶
type CaptureMode struct { Desc string Value v4l2.StreamParamFlag }
type DataFormat ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) StartStreaming ¶
func (*Device) StopStreaming ¶
func (dev *Device) StopStreaming()
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewProtocolDriver ¶
func NewProtocolDriver() *Driver
NewProtocolDriver initializes the singleton Driver and returns it to the caller
func (*Driver) AddDevice ¶
func (d *Driver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
AddDevice is a callback function that is invoked when a new Device associated with this Device Service is added
func (*Driver) Discover ¶
func (d *Driver) Discover()
Discover triggers protocol specific device discovery, which is an asynchronous operation. Devices found as part of this discovery operation are written to the channel devices.
func (*Driver) HandleReadCommands ¶
func (d *Driver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModels.CommandRequest) ([]*sdkModels.CommandValue, error)
func (*Driver) HandleWriteCommands ¶
func (d *Driver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModels.CommandRequest, params []*sdkModels.CommandValue) error
func (*Driver) Initialize ¶
func (d *Driver) Initialize(lc logger.LoggingClient, asyncCh chan<- *sdkModels.AsyncValues, deviceCh chan<- []sdkModels.DiscoveredDevice) error
Initialize performs protocol-specific initialization for the device service.
func (*Driver) RefreshExistingDevicePaths ¶
func (d *Driver) RefreshExistingDevicePaths()
RefreshExistingDevicePaths checks whether the existing devices match the connected devices. If there is a mismatch between them, scan all paths to find the matching device and update the existing device with the correct path.
func (*Driver) RemoveDevice ¶
func (d *Driver) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
RemoveDevice is a callback function that is invoked when a Device associated with this Device Service is removed
func (*Driver) UpdateDevice ¶
func (d *Driver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
UpdateDevice is a callback function that is invoked when a Device associated with this Device Service is updated
type EdgeXErrorWrapper ¶
type EdgeXErrorWrapper struct{}
func (EdgeXErrorWrapper) CommandError ¶
func (e EdgeXErrorWrapper) CommandError(command string, err error) errors.EdgeX
type FFmpeg ¶
type FFmpeg struct {
// contains filtered or unexported fields
}
func (FFmpeg) ObtainInputFps ¶
func (FFmpeg) ObtainInputImageSize ¶
func (FFmpeg) ObtainInputPixelFormat ¶
func (FFmpeg) ObtainOutputAspect ¶
func (FFmpeg) ObtainOutputFps ¶
func (FFmpeg) ObtainOutputFrames ¶
func (FFmpeg) ObtainOutputImageSize ¶
func (FFmpeg) ObtainOutputVideoCodec ¶
func (FFmpeg) ObtainOutputVideoQuality ¶
type HttpHandler ¶
type HttpHandler struct {
// contains filtered or unexported fields
}
func NewHttpHandler ¶
func NewHttpHandler(driver *Driver) HttpHandler
func (HttpHandler) RefreshExistingDevicePaths ¶
func (h HttpHandler) RefreshExistingDevicePaths(writer http.ResponseWriter, request *http.Request)
type ImageFormat ¶
type StreamingCapability ¶
type StreamingCapability struct { Desc string Value v4l2.StreamParamFlag }
type StreamingParameters ¶
type StreamingParameters struct { Capability StreamingCapability CaptureMode CaptureMode TimePerFrame v4l2.Fract ReadBuffers uint32 }