Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: media/video/capture/win/video_capture_device_factory_win.cc

Issue 332863002: Video Capture: Allow 0 fps frame rates to be deserializable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip 0 fps supported format(s). Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/video/capture/video_capture_types.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_factory_win.h" 5 #include "media/video/capture/win/video_capture_device_factory_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/command_line.h" 10 #include "base/command_line.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 VideoCaptureFormat format; 291 VideoCaptureFormat format;
292 format.pixel_format = 292 format.pixel_format =
293 VideoCaptureDeviceWin::TranslateMediaSubtypeToPixelFormat( 293 VideoCaptureDeviceWin::TranslateMediaSubtypeToPixelFormat(
294 media_type->subtype); 294 media_type->subtype);
295 if (format.pixel_format == PIXEL_FORMAT_UNKNOWN) 295 if (format.pixel_format == PIXEL_FORMAT_UNKNOWN)
296 continue; 296 continue;
297 VIDEOINFOHEADER* h = 297 VIDEOINFOHEADER* h =
298 reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat); 298 reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat);
299 format.frame_size.SetSize(h->bmiHeader.biWidth, 299 format.frame_size.SetSize(h->bmiHeader.biWidth,
300 h->bmiHeader.biHeight); 300 h->bmiHeader.biHeight);
301 if (!h->AvgTimePerFrame)
perkj_chrome 2014/06/19 11:23:35 So this does not add the format at all. Is that re
302 continue;
301 // Trust the frame rate from the VIDEOINFOHEADER. 303 // Trust the frame rate from the VIDEOINFOHEADER.
302 format.frame_rate = (h->AvgTimePerFrame > 0) ? 304 format.frame_rate =
303 kSecondsToReferenceTime / static_cast<float>(h->AvgTimePerFrame) : 305 kSecondsToReferenceTime / static_cast<float>(h->AvgTimePerFrame);
304 0.0;
305 306
306 formats->push_back(format); 307 formats->push_back(format);
307 DVLOG(1) << device.name() << " resolution: " 308 DVLOG(1) << device.name() << " resolution: "
308 << format.frame_size.ToString() << ", fps: " << format.frame_rate 309 << format.frame_size.ToString() << ", fps: " << format.frame_rate
309 << ", pixel format: " << format.pixel_format; 310 << ", pixel format: " << format.pixel_format;
310 } 311 }
311 } 312 }
312 } 313 }
313 } 314 }
314 315
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 const VideoCaptureDevice::Name& device, 442 const VideoCaptureDevice::Name& device,
442 VideoCaptureFormats* formats) { 443 VideoCaptureFormats* formats) {
443 DCHECK(thread_checker_.CalledOnValidThread()); 444 DCHECK(thread_checker_.CalledOnValidThread());
444 if (use_media_foundation_) 445 if (use_media_foundation_)
445 GetDeviceSupportedFormatsMediaFoundation(device, formats); 446 GetDeviceSupportedFormatsMediaFoundation(device, formats);
446 else 447 else
447 GetDeviceSupportedFormatsDirectShow(device, formats); 448 GetDeviceSupportedFormatsDirectShow(device, formats);
448 } 449 }
449 450
450 } // namespace media 451 } // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/video_capture_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698