diff --git a/mediadevices_test.go b/mediadevices_test.go index f5024a86..247813ac 100644 --- a/mediadevices_test.go +++ b/mediadevices_test.go @@ -125,18 +125,6 @@ func TestSelectBestDriverConstraintsResultIsSetProperly(t *testing.T) { frameFormat: frame.FormatI420, frameRate: expectedProp.FrameRate, }, - "DifferentFrameRate": { - width: expectedProp.Width, - height: expectedProp.Height, - frameFormat: expectedProp.FrameFormat, - frameRate: expectedProp.FrameRate - 1, - }, - "NoFrameRateConstraints": { - width: expectedProp.Width, - height: expectedProp.Height, - frameFormat: expectedProp.FrameFormat, - frameRate: -1, - }, } for name, c := range cases { @@ -229,12 +217,6 @@ func TestSelectBestDriverConstraintsNoFit(t *testing.T) { frameFormat: frame.FormatI420, frameRate: expectedProp.FrameRate, }, - "DifferentFrameRate": { - width: expectedProp.Width, - height: expectedProp.Height, - frameFormat: expectedProp.FrameFormat, - frameRate: expectedProp.FrameRate - 1, - }, } for name, c := range cases { diff --git a/pkg/prop/prop.go b/pkg/prop/prop.go index 90edde79..3499413f 100644 --- a/pkg/prop/prop.go +++ b/pkg/prop/prop.go @@ -145,14 +145,17 @@ func (p *MediaConstraints) FitnessDistance(o Media) (float64, bool) { cmps.add(p.Width, o.Width) cmps.add(p.Height, o.Height) cmps.add(p.FrameFormat, o.FrameFormat) - cmps.add(p.FrameRate, o.FrameRate) + // The next line is comment out for now to not include framerate in the fitness function. + // As camera.Properties does not have access to the list of available framerate at the moment, + // no driver can be matched with a framerate constraint. + // Note this also affect screen caputre as screen.Properties does not fill in the Framerate field. + // cmps.add(p.FrameRate, o.FrameRate) cmps.add(p.SampleRate, o.SampleRate) cmps.add(p.Latency, o.Latency) cmps.add(p.ChannelCount, o.ChannelCount) cmps.add(p.IsBigEndian, o.IsBigEndian) cmps.add(p.IsFloat, o.IsFloat) cmps.add(p.IsInterleaved, o.IsInterleaved) - return cmps.fitnessDistance() }