Fix included unsupported formats

This commit is contained in:
Lukas Herman
2020-10-13 22:24:19 -07:00
parent 0f5df05c16
commit e4b1b1aaba

View File

@@ -185,11 +185,16 @@ func (c *camera) Properties() []prop.Media {
properties := make([]prop.Media, 0) properties := make([]prop.Media, 0)
for format := range c.cam.GetSupportedFormats() { for format := range c.cam.GetSupportedFormats() {
for _, frameSize := range c.cam.GetSupportedFrameSizes(format) { for _, frameSize := range c.cam.GetSupportedFrameSizes(format) {
supportedFormat, ok := c.formats[format]
if !ok {
continue
}
properties = append(properties, prop.Media{ properties = append(properties, prop.Media{
Video: prop.Video{ Video: prop.Video{
Width: int(frameSize.MaxWidth), Width: int(frameSize.MaxWidth),
Height: int(frameSize.MaxHeight), Height: int(frameSize.MaxHeight),
FrameFormat: c.formats[format], FrameFormat: supportedFormat,
}, },
}) })
} }