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/capture/video/win/video_capture_device_mf_win.h" | 5 #include "media/capture/video/win/video_capture_device_mf_win.h" |
6 | 6 |
7 #include <mfapi.h> | 7 #include <mfapi.h> |
8 #include <mferror.h> | 8 #include <mferror.h> |
9 | 9 |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } static const kFormatMap[] = { | 164 } static const kFormatMap[] = { |
165 {MFVideoFormat_I420, PIXEL_FORMAT_I420}, | 165 {MFVideoFormat_I420, PIXEL_FORMAT_I420}, |
166 {MFVideoFormat_YUY2, PIXEL_FORMAT_YUY2}, | 166 {MFVideoFormat_YUY2, PIXEL_FORMAT_YUY2}, |
167 {MFVideoFormat_UYVY, PIXEL_FORMAT_UYVY}, | 167 {MFVideoFormat_UYVY, PIXEL_FORMAT_UYVY}, |
168 {MFVideoFormat_RGB24, PIXEL_FORMAT_RGB24}, | 168 {MFVideoFormat_RGB24, PIXEL_FORMAT_RGB24}, |
169 {MFVideoFormat_ARGB32, PIXEL_FORMAT_ARGB}, | 169 {MFVideoFormat_ARGB32, PIXEL_FORMAT_ARGB}, |
170 {MFVideoFormat_MJPG, PIXEL_FORMAT_MJPEG}, | 170 {MFVideoFormat_MJPG, PIXEL_FORMAT_MJPEG}, |
171 {MFVideoFormat_YV12, PIXEL_FORMAT_YV12}, | 171 {MFVideoFormat_YV12, PIXEL_FORMAT_YV12}, |
172 }; | 172 }; |
173 | 173 |
174 for (int i = 0; i < arraysize(kFormatMap); ++i) { | 174 for (const auto& kFormat : kFormatMap) { |
175 if (kFormatMap[i].guid == guid) { | 175 if (kFormat.guid == guid) { |
176 *format = kFormatMap[i].format; | 176 *format = kFormat.format; |
177 return true; | 177 return true; |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 return false; | 181 return false; |
182 } | 182 } |
183 | 183 |
184 const std::string VideoCaptureDevice::Name::GetModel() const { | 184 const std::string VideoCaptureDevice::Name::GetModel() const { |
185 const size_t vid_prefix_size = sizeof(kVidPrefix) - 1; | 185 const size_t vid_prefix_size = sizeof(kVidPrefix) - 1; |
186 const size_t pid_prefix_size = sizeof(kPidPrefix) - 1; | 186 const size_t pid_prefix_size = sizeof(kPidPrefix) - 1; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 HRESULT hr) { | 322 HRESULT hr) { |
323 if (client_.get()) { | 323 if (client_.get()) { |
324 client_->OnError( | 324 client_->OnError( |
325 from_here, | 325 from_here, |
326 base::StringPrintf("VideoCaptureDeviceMFWin: %s", | 326 base::StringPrintf("VideoCaptureDeviceMFWin: %s", |
327 logging::SystemErrorCodeToString(hr).c_str())); | 327 logging::SystemErrorCodeToString(hr).c_str())); |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 } // namespace media | 331 } // namespace media |
OLD | NEW |