Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1048)

Unified Diff: media/video/capture/video_capture_device.h

Issue 558623002: Video capture: Refactor GetBestMatchedFormat from Win to OS independent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: preserve original behaviour Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698