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 }, |
145 }; | 146 }; |
146 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(pixel_formats); ++i) { | 147 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(pixel_formats); ++i) { |
147 if (sub_type == pixel_formats[i].sub_type) | 148 if (sub_type == pixel_formats[i].sub_type) |
148 return pixel_formats[i].format; | 149 return pixel_formats[i].format; |
149 } | 150 } |
150 #ifndef NDEBUG | 151 #ifndef NDEBUG |
151 WCHAR guid_str[128]; | 152 WCHAR guid_str[128]; |
152 StringFromGUID2(sub_type, guid_str, arraysize(guid_str)); | 153 StringFromGUID2(sub_type, guid_str, arraysize(guid_str)); |
153 DVLOG(2) << "Device (also) supports an unknown media type " << guid_str; | 154 DVLOG(2) << "Device (also) supports an unknown media type " << guid_str; |
154 #endif | 155 #endif |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 } | 540 } |
540 } | 541 } |
541 | 542 |
542 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { | 543 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { |
543 DCHECK(CalledOnValidThread()); | 544 DCHECK(CalledOnValidThread()); |
544 DVLOG(1) << reason; | 545 DVLOG(1) << reason; |
545 state_ = kError; | 546 state_ = kError; |
546 client_->OnError(reason); | 547 client_->OnError(reason); |
547 } | 548 } |
548 } // namespace media | 549 } // namespace media |
OLD | NEW |