The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/b4088a976e8f6076f433ac831122b18e24a8b70b
commit b4088a976e8f6076f433ac831122b18e24a8b70b
Author: Guido Urdaneta <guidou@chromium.org>
Date: Wed Nov 21 12:42:08 2018
Fix fitness distance in video capture constraints processing
The old algorithm computed fitness for width, height and aspect ratio
using the best possible width, height and aspect ratio supported
by a constrained format. However, the actual selected resolution does not
necessarily have the width, height and aspect ratio that are
simultaneously closest to the ideal values.
In practice, this results in differences only in marginal cases such as:
* Extreme ideal aspect ratios, where rounding a selected resolution
in floating-point format might lead to a significant variation in
aspect ratio. For example (1000x1.25 has aspect ratio 800 before rounding
but aspect ratio 1000 after rounding to 1000x1). This is not an issue
for resolutions that are used in practice and the spec allows some
deviation in the optimization of the fitness distance anyway.
* The ideal aspect ratio significantly contradicts the ratio between
the ideal width and the ideal height. In this case, the selected point
will be close to ideal width and ideal height, but might be far from
the ideal aspect ratio (which is ignored), thus it might have a higher
fitness distance than the one computed by the old algorithm.
This minor fix has more importance when extra complexity is added to
the computation of fitness distance to support the new resizeMode
constraint in a follow-up CL.
Bug: 854980
Change-Id: I0cadb28553816357ce84bbf38b5686cc48b427e7
Reviewed-on: https://chromium-review.googlesource.com/c/1329788
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610015}
[modify] https://crrev.com/b4088a976e8f6076f433ac831122b18e24a8b70b/content/renderer/media/stream/media_stream_constraints_util_video_device.cc
[modify] https://crrev.com/b4088a976e8f6076f433ac831122b18e24a8b70b/content/renderer/media/stream/media_stream_constraints_util_video_device_unittest.cc
Comment 1 by guidou@chromium.org
, Jun 21 2018Owner: guidou@chromium.org
Status: Assigned (was: Untriaged)