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

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

Issue 489183003: Log error messages in windows video capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: syntax error : missing ')' Created 6 years, 4 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
Index: media/video/capture/win/video_capture_device_factory_win.cc
diff --git a/media/video/capture/win/video_capture_device_factory_win.cc b/media/video/capture/win/video_capture_device_factory_win.cc
index 75ee59d3bf495be332468550d2bb9ef22a16ef5d..cacf9811590e9671b5d53adcc6e7fe470ba48792 100644
--- a/media/video/capture/win/video_capture_device_factory_win.cc
+++ b/media/video/capture/win/video_capture_device_factory_win.cc
@@ -185,8 +185,8 @@ static void GetDeviceNamesMediaFoundation(
VideoCaptureDevice::Name::MEDIA_FOUNDATION));
}
}
- if (FAILED(hr))
- DLOG(WARNING) << "GetAllocatedString failed: " << std::hex << hr;
+ DLOG_IF(ERROR, FAILED(hr)) << "GetAllocatedString failed: "
+ << logging::SystemErrorCodeToString(hr);
tommi (sloooow) - chröme 2014/08/30 17:39:33 nit: it might also be good to include the numeric
magjed_chromium 2014/09/01 08:34:14 See message.
devices[i]->Release();
}
}
@@ -216,7 +216,8 @@ static void GetDeviceSupportedFormatsDirectShow(
hr = VideoCaptureDeviceWin::GetDeviceFilter(device,
capture_filter.Receive());
if (!capture_filter) {
- DVLOG(2) << "Failed to create capture filter.";
+ DLOG(ERROR) << "Failed to create capture filter: "
+ << logging::SystemErrorCodeToString(hr);
return;
}
@@ -225,22 +226,23 @@ static void GetDeviceSupportedFormatsDirectShow(
PINDIR_OUTPUT,
PIN_CATEGORY_CAPTURE));
if (!output_capture_pin) {
- DVLOG(2) << "Failed to get capture output pin";
+ DLOG(ERROR) << "Failed to get capture output pin";
return;
}
ScopedComPtr<IAMStreamConfig> stream_config;
hr = output_capture_pin.QueryInterface(stream_config.Receive());
if (FAILED(hr)) {
- DVLOG(2) << "Failed to get IAMStreamConfig interface from "
- "capture device";
+ DLOG(ERROR) << "Failed to get IAMStreamConfig interface from "
+ "capture device: " << logging::SystemErrorCodeToString(hr);
return;
}
int count = 0, size = 0;
hr = stream_config->GetNumberOfCapabilities(&count, &size);
if (FAILED(hr)) {
- DVLOG(2) << "Failed to GetNumberOfCapabilities";
+ DLOG(ERROR) << "GetNumberOfCapabilities failed: "
+ << logging::SystemErrorCodeToString(hr);
return;
}
@@ -251,7 +253,8 @@ static void GetDeviceSupportedFormatsDirectShow(
// GetStreamCaps() may return S_FALSE, so don't use FAILED() or SUCCEED()
// macros here since they'll trigger incorrectly.
if (hr != S_OK) {
- DVLOG(2) << "Failed to GetStreamCaps";
+ DLOG(ERROR) << "GetStreamCaps failed: "
+ << logging::SystemErrorCodeToString(hr);
return;
}
@@ -293,7 +296,8 @@ static void GetDeviceSupportedFormatsMediaFoundation(
HRESULT hr =
MFCreateSourceReaderFromMediaSource(source, NULL, reader.Receive());
if (FAILED(hr)) {
- DLOG(ERROR) << "MFCreateSourceReaderFromMediaSource: " << std::hex << hr;
+ DLOG(ERROR) << "MFCreateSourceReaderFromMediaSource failed: "
+ << logging::SystemErrorCodeToString(hr);
return;
}
@@ -307,7 +311,8 @@ static void GetDeviceSupportedFormatsMediaFoundation(
UINT32 width, height;
hr = MFGetAttributeSize(type, MF_MT_FRAME_SIZE, &width, &height);
if (FAILED(hr)) {
- DLOG(ERROR) << "MFGetAttributeSize: " << std::hex << hr;
+ DLOG(ERROR) << "MFGetAttributeSize failed: "
+ << logging::SystemErrorCodeToString(hr);
return;
}
VideoCaptureFormat capture_format;
@@ -316,7 +321,8 @@ static void GetDeviceSupportedFormatsMediaFoundation(
UINT32 numerator, denominator;
hr = MFGetAttributeRatio(type, MF_MT_FRAME_RATE, &numerator, &denominator);
if (FAILED(hr)) {
- DLOG(ERROR) << "MFGetAttributeSize: " << std::hex << hr;
+ DLOG(ERROR) << "MFGetAttributeSize failed: "
+ << logging::SystemErrorCodeToString(hr);
return;
}
capture_format.frame_rate = denominator
@@ -325,7 +331,8 @@ static void GetDeviceSupportedFormatsMediaFoundation(
GUID type_guid;
hr = type->GetGUID(MF_MT_SUBTYPE, &type_guid);
if (FAILED(hr)) {
- DLOG(ERROR) << "GetGUID: " << std::hex << hr;
+ DLOG(ERROR) << "GetGUID failed: "
+ << logging::SystemErrorCodeToString(hr);
return;
}
VideoCaptureDeviceMFWin::FormatFromGuid(type_guid,

Powered by Google App Engine
This is Rietveld 408576698