OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/base/video_capture_types.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 NOTREACHED() << "Invalid VideoPixelStorage provided: " | 91 NOTREACHED() << "Invalid VideoPixelStorage provided: " |
92 << static_cast<int>(storage); | 92 << static_cast<int>(storage); |
93 return std::string(); | 93 return std::string(); |
94 } | 94 } |
95 | 95 |
96 // static | 96 // static |
97 bool VideoCaptureFormat::ComparePixelFormatPreference( | 97 bool VideoCaptureFormat::ComparePixelFormatPreference( |
98 const VideoPixelFormat& lhs, | 98 const VideoPixelFormat& lhs, |
99 const VideoPixelFormat& rhs) { | 99 const VideoPixelFormat& rhs) { |
100 const auto& format_lhs = std::find( | 100 auto* format_lhs = std::find( |
101 kSupportedCapturePixelFormats, | 101 kSupportedCapturePixelFormats, |
102 kSupportedCapturePixelFormats + arraysize(kSupportedCapturePixelFormats), | 102 kSupportedCapturePixelFormats + arraysize(kSupportedCapturePixelFormats), |
103 lhs); | 103 lhs); |
104 const auto& format_rhs = std::find( | 104 auto* format_rhs = std::find( |
105 kSupportedCapturePixelFormats, | 105 kSupportedCapturePixelFormats, |
106 kSupportedCapturePixelFormats + arraysize(kSupportedCapturePixelFormats), | 106 kSupportedCapturePixelFormats + arraysize(kSupportedCapturePixelFormats), |
107 rhs); | 107 rhs); |
108 return format_lhs < format_rhs; | 108 return format_lhs < format_rhs; |
109 } | 109 } |
110 | 110 |
111 VideoCaptureParams::VideoCaptureParams() | 111 VideoCaptureParams::VideoCaptureParams() |
112 : resolution_change_policy(RESOLUTION_POLICY_FIXED_RESOLUTION), | 112 : resolution_change_policy(RESOLUTION_POLICY_FIXED_RESOLUTION), |
113 power_line_frequency(PowerLineFrequency::FREQUENCY_DEFAULT) {} | 113 power_line_frequency(PowerLineFrequency::FREQUENCY_DEFAULT) {} |
114 | 114 |
115 bool VideoCaptureParams::IsValid() const { | 115 bool VideoCaptureParams::IsValid() const { |
116 return requested_format.IsValid() && | 116 return requested_format.IsValid() && |
117 resolution_change_policy >= RESOLUTION_POLICY_FIXED_RESOLUTION && | 117 resolution_change_policy >= RESOLUTION_POLICY_FIXED_RESOLUTION && |
118 resolution_change_policy <= RESOLUTION_POLICY_LAST && | 118 resolution_change_policy <= RESOLUTION_POLICY_LAST && |
119 power_line_frequency >= PowerLineFrequency::FREQUENCY_DEFAULT && | 119 power_line_frequency >= PowerLineFrequency::FREQUENCY_DEFAULT && |
120 power_line_frequency <= PowerLineFrequency::FREQUENCY_MAX; | 120 power_line_frequency <= PowerLineFrequency::FREQUENCY_MAX; |
121 } | 121 } |
122 | 122 |
123 } // namespace media | 123 } // namespace media |
OLD | NEW |