mirror of
https://github.com/pion/mediadevices.git
synced 2025-10-05 16:46:51 +08:00
Fix included unsupported formats
This commit is contained in:
@@ -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,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user