| 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/video/capture/win/video_capture_device_win.h" | 5 #include "media/video/capture/win/video_capture_device_win.h" |
| 6 | 6 |
| 7 #include <ks.h> | 7 #include <ks.h> |
| 8 #include <ksmedia.h> | 8 #include <ksmedia.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const GUID& sub_type; | 135 const GUID& sub_type; |
| 136 VideoPixelFormat format; | 136 VideoPixelFormat format; |
| 137 } pixel_formats[] = { | 137 } pixel_formats[] = { |
| 138 { kMediaSubTypeI420, PIXEL_FORMAT_I420 }, | 138 { kMediaSubTypeI420, PIXEL_FORMAT_I420 }, |
| 139 { MEDIASUBTYPE_IYUV, PIXEL_FORMAT_I420 }, | 139 { MEDIASUBTYPE_IYUV, PIXEL_FORMAT_I420 }, |
| 140 { MEDIASUBTYPE_RGB24, PIXEL_FORMAT_RGB24 }, | 140 { MEDIASUBTYPE_RGB24, PIXEL_FORMAT_RGB24 }, |
| 141 { MEDIASUBTYPE_YUY2, PIXEL_FORMAT_YUY2 }, | 141 { MEDIASUBTYPE_YUY2, PIXEL_FORMAT_YUY2 }, |
| 142 { MEDIASUBTYPE_MJPG, PIXEL_FORMAT_MJPEG }, | 142 { MEDIASUBTYPE_MJPG, PIXEL_FORMAT_MJPEG }, |
| 143 { MEDIASUBTYPE_UYVY, PIXEL_FORMAT_UYVY }, | 143 { MEDIASUBTYPE_UYVY, PIXEL_FORMAT_UYVY }, |
| 144 { MEDIASUBTYPE_ARGB32, PIXEL_FORMAT_ARGB }, | 144 { MEDIASUBTYPE_ARGB32, PIXEL_FORMAT_ARGB }, |
| 145 { kMediaSubTypeHDYC, PIXEL_FORMAT_UYVY }, | |
| 146 }; | 145 }; |
| 147 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(pixel_formats); ++i) { | 146 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(pixel_formats); ++i) { |
| 148 if (sub_type == pixel_formats[i].sub_type) | 147 if (sub_type == pixel_formats[i].sub_type) |
| 149 return pixel_formats[i].format; | 148 return pixel_formats[i].format; |
| 150 } | 149 } |
| 151 #ifndef NDEBUG | 150 #ifndef NDEBUG |
| 152 WCHAR guid_str[128]; | 151 WCHAR guid_str[128]; |
| 153 StringFromGUID2(sub_type, guid_str, arraysize(guid_str)); | 152 StringFromGUID2(sub_type, guid_str, arraysize(guid_str)); |
| 154 DVLOG(2) << "Device (also) supports an unknown media type " << guid_str; | 153 DVLOG(2) << "Device (also) supports an unknown media type " << guid_str; |
| 155 #endif | 154 #endif |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 } | 539 } |
| 541 } | 540 } |
| 542 | 541 |
| 543 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { | 542 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { |
| 544 DCHECK(CalledOnValidThread()); | 543 DCHECK(CalledOnValidThread()); |
| 545 DVLOG(1) << reason; | 544 DVLOG(1) << reason; |
| 546 state_ = kError; | 545 state_ = kError; |
| 547 client_->OnError(reason); | 546 client_->OnError(reason); |
| 548 } | 547 } |
| 549 } // namespace media | 548 } // namespace media |
| OLD | NEW |