| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/video_capture_types.h" | 5 #include "device/capture/video/win/capability_list_win.h" |
| 6 #include "media/capture/video/win/capability_list_win.h" | |
| 7 | 6 |
| 8 #include <algorithm> | 7 #include <algorithm> |
| 9 #include <functional> | 8 #include <functional> |
| 10 | 9 |
| 11 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "media/base/video_capture_types.h" |
| 12 |
| 12 | 13 |
| 13 namespace media { | 14 namespace media { |
| 14 | 15 |
| 15 static bool CompareCapability(const VideoCaptureFormat& requested, | 16 static bool CompareCapability(const VideoCaptureFormat& requested, |
| 16 const CapabilityWin& capability_lhs, | 17 const CapabilityWin& capability_lhs, |
| 17 const CapabilityWin& capability_rhs) { | 18 const CapabilityWin& capability_rhs) { |
| 18 const VideoCaptureFormat& lhs = capability_lhs.supported_format; | 19 const VideoCaptureFormat& lhs = capability_lhs.supported_format; |
| 19 const VideoCaptureFormat& rhs = capability_rhs.supported_format; | 20 const VideoCaptureFormat& rhs = capability_rhs.supported_format; |
| 20 | 21 |
| 21 const int diff_height_lhs = | 22 const int diff_height_lhs = |
| (...skipping 25 matching lines...) Expand all Loading... |
| 47 DCHECK(!capabilities.empty()); | 48 DCHECK(!capabilities.empty()); |
| 48 const CapabilityWin* best_match = &(*capabilities.begin()); | 49 const CapabilityWin* best_match = &(*capabilities.begin()); |
| 49 for (const CapabilityWin& capability : capabilities) { | 50 for (const CapabilityWin& capability : capabilities) { |
| 50 if (CompareCapability(requested, capability, *best_match)) | 51 if (CompareCapability(requested, capability, *best_match)) |
| 51 best_match = &capability; | 52 best_match = &capability; |
| 52 } | 53 } |
| 53 return *best_match; | 54 return *best_match; |
| 54 } | 55 } |
| 55 | 56 |
| 56 } // namespace media | 57 } // namespace media |
| OLD | NEW |