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

Unified Diff: media/video/capture/win/video_capture_device_win.cc

Issue 900233002: Enumerate MJPEG as the prefered format if set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nit. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/video/capture/win/sink_input_pin_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bd68e3dfdac6d206ecd7f9e03142316e55d80376..0a4ff690ffe46ce52db34adda9c9e6e63dfeb273 100644
--- a/media/video/capture/win/video_capture_device_win.cc
+++ b/media/video/capture/win/video_capture_device_win.cc
@@ -351,22 +351,21 @@ void VideoCaptureDeviceWin::AllocateAndStart(
if (hr != S_OK) {
SetErrorState("Failed to get capture device capabilities");
return;
- } else {
- if (media_type->formattype == FORMAT_VideoInfo) {
- VIDEOINFOHEADER* h =
- reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat);
- if (format.frame_rate > 0)
- h->AvgTimePerFrame = kSecondsToReferenceTime / format.frame_rate;
- }
- // Set the sink filter to request this format.
- sink_filter_->SetRequestedMediaFormat(format);
- // Order the capture device to use this format.
- hr = stream_config->SetFormat(media_type.get());
- if (FAILED(hr)) {
- // TODO(grunell): Log the error. http://crbug.com/405016.
- SetErrorState("Failed to set capture device output format");
- return;
- }
+ }
+ if (media_type->formattype == FORMAT_VideoInfo) {
+ VIDEOINFOHEADER* h =
+ reinterpret_cast<VIDEOINFOHEADER*>(media_type->pbFormat);
+ if (format.frame_rate > 0)
+ h->AvgTimePerFrame = kSecondsToReferenceTime / format.frame_rate;
+ }
+ // Set the sink filter to request this format.
+ sink_filter_->SetRequestedMediaFormat(format);
+ // Order the capture device to use this format.
+ hr = stream_config->SetFormat(media_type.get());
+ if (FAILED(hr)) {
+ // TODO(grunell): Log the error. http://crbug.com/405016.
+ SetErrorState("Failed to set capture device output format");
+ return;
}
SetAntiFlickerInCaptureFilter();
« no previous file with comments | « media/video/capture/win/sink_input_pin_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698