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

Unified Diff: media/video/capture/video_capture_types.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: change diff type from int to float Created 6 years, 3 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_types.h
diff --git a/media/video/capture/video_capture_types.h b/media/video/capture/video_capture_types.h
index ec57c451372831580b5476befa53d4acf6398982..0be65e6f6f0d1015de0b311aa006e5ca8b83e3e5 100644
--- a/media/video/capture/video_capture_types.h
+++ b/media/video/capture/video_capture_types.h
@@ -92,6 +92,15 @@ class MEDIA_EXPORT VideoCaptureParams {
ResolutionChangePolicy resolution_change_policy;
};
+// 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.
+// Returns the L1/Manhattan distance for resolution and frame rate between lhs
+// and rhs. Return value is float because we need to distinguish between
+// rational frame rates (e.g. 30.0 and 29.97)
+float DiffVideoCaptureFormat(const VideoCaptureFormat& lhs,
perkj_chrome 2014/09/24 07:56:29 Is it possible to place this method somewhere else
magjed_chromium 2014/09/24 10:33:25 Will fix in next upload.
+ const VideoCaptureFormat& rhs);
+
} // namespace media
#endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_

Powered by Google App Engine
This is Rietveld 408576698