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

Unified Diff: media/video/capture/win/capability_list_win.cc

Issue 83633008: Reland: Reorganize media::VideoCapture* types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « media/video/capture/win/capability_list_win.h ('k') | media/video/capture/win/sink_filter_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/win/capability_list_win.cc
diff --git a/media/video/capture/win/capability_list_win.cc b/media/video/capture/win/capability_list_win.cc
index 18325bb63988566a52e6adc721539959be486abb..bfa58edcc4bec89b88451e6359e59521cbe8525e 100644
--- a/media/video/capture/win/capability_list_win.cc
+++ b/media/video/capture/win/capability_list_win.cc
@@ -33,7 +33,8 @@ bool CompareFrameRate(const ResolutionDiff& item1,
}
bool CompareColor(const ResolutionDiff& item1, const ResolutionDiff& item2) {
- return item1.capability->color < item2.capability->color;
+ return item1.capability->supported_format.pixel_format <
+ item2.capability->supported_format.pixel_format;
}
} // namespace.
@@ -50,7 +51,7 @@ void CapabilityList::Add(const VideoCaptureCapabilityWin& capability) {
capabilities_.push_back(capability);
}
-const VideoCaptureCapabilityWin& CapabilityList::GetBestMatchedCapability(
+const VideoCaptureCapabilityWin& CapabilityList::GetBestMatchedFormat(
int requested_width,
int requested_height,
int requested_frame_rate) const {
@@ -65,8 +66,9 @@ const VideoCaptureCapabilityWin& CapabilityList::GetBestMatchedCapability(
it != capabilities_.end(); ++it) {
ResolutionDiff diff;
diff.capability = &(*it);
- diff.diff_width = it->width - requested_width;
- diff.diff_height = it->height - requested_height;
+ diff.diff_width = it->supported_format.frame_size.width() - requested_width;
+ diff.diff_height =
+ it->supported_format.frame_size.height() - requested_height;
// The 1000 allows using integer arithmetic for f.i. 29.971 fps.
diff.diff_frame_rate =
1000 * ((static_cast<float>(it->frame_rate_numerator) /
« no previous file with comments | « media/video/capture/win/capability_list_win.h ('k') | media/video/capture/win/sink_filter_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698