Index: media/video/capture/video_capture_types.cc |
diff --git a/media/video/capture/video_capture_types.cc b/media/video/capture/video_capture_types.cc |
index ce5c354e290eed22fef06f69a067b4cf2d01265c..56671df9f2972a99d39ebcea0a5917566032b7ba 100644 |
--- a/media/video/capture/video_capture_types.cc |
+++ b/media/video/capture/video_capture_types.cc |
@@ -4,6 +4,8 @@ |
#include "media/video/capture/video_capture_types.h" |
+#include <cmath> |
+ |
#include "base/logging.h" |
#include "base/strings/stringprintf.h" |
#include "media/base/limits.h" |
@@ -69,4 +71,17 @@ std::string VideoCaptureFormat::PixelFormatToString(VideoPixelFormat format) { |
VideoCaptureParams::VideoCaptureParams() |
: resolution_change_policy(RESOLUTION_POLICY_FIXED) {} |
+ |
+int DiffVideoCaptureFormat(const VideoCaptureFormat& lhs, |
+ const VideoCaptureFormat& rhs) { |
+ // Distinguish between rational frames rates by multiplying with |
+ // kFrameRatePrecision. Multiply frame size as well to make it have |
+ // precedence over frame rate. |
mcasas
2014/09/23 12:34:57
This comment doesn't read clearly to me, can you p
|
+ return kFrameRatePrecision * |
+ (std::abs(lhs.frame_size.width() - rhs.frame_size.width()) + |
+ std::abs(lhs.frame_size.height() - rhs.frame_size.height())) + |
+ static_cast<int>(kFrameRatePrecision * |
+ std::fabs(lhs.frame_rate - rhs.frame_rate)); |
mcasas
2014/09/23 12:34:57
what about:
return kFrameRatePrecision *
(st
magjed_chromium
2014/09/23 14:39:54
The reason for not factoring kFrameRatePrecision i
|
+} |
+ |
} // namespace media |