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

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

Issue 489183003: Log error messages in windows video capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor log message to os independendent 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_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 a7d1f104cdc2bbaf16f2ec9849809dc77bf6cb4d..e69f3bcc726d87c560e04461ebf5acb30ad42cd4 100644
--- a/media/video/capture/win/video_capture_device_win.cc
+++ b/media/video/capture/win/video_capture_device_win.cc
@@ -68,7 +68,7 @@ HRESULT VideoCaptureDeviceWin::GetDeviceFilter(
// We have found the requested device
hr = moniker->BindToObject(0, 0, IID_IBaseFilter,
capture_filter.ReceiveVoid());
- DVPLOG_IF(2, FAILED(hr)) << "Failed to bind camera filter.";
+ DPLOG_IF(ERROR, FAILED(hr)) << "Failed to bind camera filter";
tommi (sloooow) - chröme 2014/08/27 14:46:18 ah, I see you're already using it
break;
}
}
@@ -224,21 +224,21 @@ bool VideoCaptureDeviceWin::Init() {
DCHECK(CalledOnValidThread());
HRESULT hr = GetDeviceFilter(device_name_, capture_filter_.Receive());
if (!capture_filter_) {
- DVLOG(2) << "Failed to create capture filter.";
+ DPLOG(ERROR) << "Failed to create capture filter";
return false;
}
output_capture_pin_ =
GetPin(capture_filter_, PINDIR_OUTPUT, PIN_CATEGORY_CAPTURE);
if (!output_capture_pin_) {
- DVLOG(2) << "Failed to get capture output pin";
+ DPLOG(ERROR) << "Failed to get capture output pin";
return false;
}
// Create the sink filter used for receiving Captured frames.
sink_filter_ = new SinkFilter(this);
if (sink_filter_ == NULL) {
- DVLOG(2) << "Failed to create send filter";
+ DPLOG(ERROR) << "Failed to create send filter";
return false;
}
@@ -247,25 +247,25 @@ bool VideoCaptureDeviceWin::Init() {
hr = graph_builder_.CreateInstance(CLSID_FilterGraph, NULL,
CLSCTX_INPROC_SERVER);
if (FAILED(hr)) {
- DVLOG(2) << "Failed to create graph builder.";
+ DPLOG(ERROR) << "Failed to create graph builder";
return false;
}
hr = graph_builder_.QueryInterface(media_control_.Receive());
if (FAILED(hr)) {
- DVLOG(2) << "Failed to create media control builder.";
+ DPLOG(ERROR) << "Failed to create media control builder";
return false;
}
hr = graph_builder_->AddFilter(capture_filter_, NULL);
if (FAILED(hr)) {
- DVLOG(2) << "Failed to add the capture device to the graph.";
+ DPLOG(ERROR) << "Failed to add the capture device to the graph";
return false;
}
hr = graph_builder_->AddFilter(sink_filter_, NULL);
if (FAILED(hr)) {
- DVLOG(2)<< "Failed to add the send filter to the graph.";
+ DPLOG(ERROR)<< "Failed to add the send filter to the graph";
return false;
}
@@ -438,20 +438,20 @@ bool VideoCaptureDeviceWin::CreateCapabilityMap() {
ScopedComPtr<IAMStreamConfig> stream_config;
HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive());
if (FAILED(hr)) {
- DVLOG(2) << "Failed to get IAMStreamConfig interface from "
- "capture device";
+ DPLOG(ERROR) << "Failed to get IAMStreamConfig interface from "
+ "capture device";
return false;
}
// Get interface used for getting the frame rate.
ScopedComPtr<IAMVideoControl> video_control;
hr = capture_filter_.QueryInterface(video_control.Receive());
- DVLOG_IF(2, FAILED(hr)) << "IAMVideoControl Interface NOT SUPPORTED";
+ DPLOG_IF(ERROR, FAILED(hr)) << "IAMVideoControl Interface NOT SUPPORTED";
int count = 0, size = 0;
hr = stream_config->GetNumberOfCapabilities(&count, &size);
if (FAILED(hr)) {
- DVLOG(2) << "Failed to GetNumberOfCapabilities";
+ DPLOG(ERROR) << "Failed to GetNumberOfCapabilities";
return false;
}
@@ -462,7 +462,7 @@ bool VideoCaptureDeviceWin::CreateCapabilityMap() {
// 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";
+ DPLOG(ERROR) << "Failed to GetStreamCaps";
return false;
}
@@ -544,7 +544,7 @@ void VideoCaptureDeviceWin::SetAntiFlickerInCaptureFilter() {
hr = ks_propset->Set(PROPSETID_VIDCAP_VIDEOPROCAMP,
KSPROPERTY_VIDEOPROCAMP_POWERLINE_FREQUENCY,
&data, sizeof(data), &data, sizeof(data));
- DVLOG_IF(ERROR, FAILED(hr)) << "Anti-flicker setting failed.";
+ DPLOG_IF(ERROR, FAILED(hr)) << "Anti-flicker setting failed";
DVLOG_IF(2, SUCCEEDED(hr)) << "Anti-flicker set correctly.";
} else {
DVLOG(2) << "Anti-flicker setting not supported.";
@@ -553,7 +553,6 @@ void VideoCaptureDeviceWin::SetAntiFlickerInCaptureFilter() {
void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) {
DCHECK(CalledOnValidThread());
- DVLOG(1) << reason;
state_ = kError;
client_->OnError(reason);
}

Powered by Google App Engine
This is Rietveld 408576698