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) / |