Index: media/video/capture/video_capture_device.h |
diff --git a/media/video/capture/video_capture_device.h b/media/video/capture/video_capture_device.h |
index 187145ffa84596ed5ea6f7eeccb3d790af4dafc2..f2aae06b70e39a8b745d3bc917ec44904d14fd5a 100644 |
--- a/media/video/capture/video_capture_device.h |
+++ b/media/video/capture/video_capture_device.h |
@@ -12,6 +12,7 @@ |
#ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
#define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
+#include <stdint.h> |
#include <list> |
#include <string> |
@@ -324,6 +325,19 @@ class MEDIA_EXPORT VideoCaptureDevice { |
static const int kPowerLine60Hz = 60; |
}; |
+// Helper function to compare video capture formats when finding the most |
+// closely matched video format given a requested video format. |
+// Smaller difference means more closely matched formats. |
+// Prioritizes according to this list: |
+// 1. Closest matching height. |
+// 2. Closest matching width. |
+// 3. Closest matching frame rate. |
+// 4. Best color format. |
+// Nr 4. is not commutative, i.e. the order of the inputs to this |
+// function matters. |
+uint64_t DiffVideoCaptureFormat(const VideoCaptureFormat& requested, |
+ const VideoCaptureFormat& supported); |
+ |
} // namespace media |
#endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |