| Index: media/video/capture/win/video_capture_device_win.cc
|
| diff --git a/media/video/capture/win/video_capture_device_win.cc b/media/video/capture/win/video_capture_device_win.cc
|
| index f56646b3264b595905da6ca8717a4302574d87d4..e78c60450dd9bd7e2f9dba5135121109e8527dbf 100644
|
| --- a/media/video/capture/win/video_capture_device_win.cc
|
| +++ b/media/video/capture/win/video_capture_device_win.cc
|
| @@ -422,17 +422,19 @@ void VideoCaptureDeviceWin::GetDeviceSupportedFormats(const Name& device,
|
|
|
| if (media_type->majortype == MEDIATYPE_Video &&
|
| media_type->formattype == FORMAT_VideoInfo) {
|
| + VideoCaptureFormat format;
|
| + format.pixel_format =
|
| + TranslateMediaSubtypeToPixelFormat(media_type->subtype);
|
| + if (format.pixel_format == PIXEL_FORMAT_UNKNOWN)
|
| + continue;
|
| VIDEOINFOHEADER* h =
|
| reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat);
|
| - VideoCaptureFormat format;
|
| format.frame_size.SetSize(h->bmiHeader.biWidth,
|
| h->bmiHeader.biHeight);
|
| // Trust the frame rate from the VIDEOINFOHEADER.
|
| format.frame_rate = (h->AvgTimePerFrame > 0) ?
|
| static_cast<int>(kSecondsToReferenceTime / h->AvgTimePerFrame) :
|
| 0;
|
| - format.pixel_format =
|
| - TranslateMediaSubtypeToPixelFormat(media_type->subtype);
|
| formats->push_back(format);
|
| DVLOG(1) << device.name() << " resolution: "
|
| << format.frame_size.ToString() << ", fps: " << format.frame_rate
|
| @@ -705,6 +707,11 @@ bool VideoCaptureDeviceWin::CreateCapabilityMap() {
|
| if (media_type->majortype == MEDIATYPE_Video &&
|
| media_type->formattype == FORMAT_VideoInfo) {
|
| VideoCaptureCapabilityWin capability(i);
|
| + capability.supported_format.pixel_format =
|
| + TranslateMediaSubtypeToPixelFormat(media_type->subtype);
|
| + if (capability.supported_format.pixel_format == PIXEL_FORMAT_UNKNOWN)
|
| + continue;
|
| +
|
| VIDEOINFOHEADER* h =
|
| reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat);
|
| capability.supported_format.frame_size.SetSize(h->bmiHeader.biWidth,
|
| @@ -745,8 +752,6 @@ bool VideoCaptureDeviceWin::CreateCapabilityMap() {
|
| capability.frame_rate_numerator = capability.supported_format.frame_rate;
|
| capability.frame_rate_denominator = 1;
|
|
|
| - capability.supported_format.pixel_format =
|
| - TranslateMediaSubtypeToPixelFormat(media_type->subtype);
|
| capabilities_.Add(capability);
|
| }
|
| }
|
|
|