Chromium Code Reviews| 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..3aa05e5bc3c57828f82f5e597ae3d6a841a88c5f 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"; |
| 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"; |
|
mcasas
2014/08/26 15:38:19
Did you introduce a tab in this line? =-0
magjed_chromium
2014/08/26 17:20:28
I introduced spaces to align the strings, accordin
|
| 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,8 +553,10 @@ void VideoCaptureDeviceWin::SetAntiFlickerInCaptureFilter() { |
| void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { |
| DCHECK(CalledOnValidThread()); |
| - DVLOG(1) << reason; |
| + const std::string last_error_message = |
| + logging::SystemErrorCodeToString(logging::GetLastSystemErrorCode()); |
| + DPLOG(ERROR) << reason; |
|
mcasas
2014/08/26 15:38:19
Similar comments as in the previous file.
magjed_chromium
2014/08/26 17:20:28
Done.
|
| state_ = kError; |
| - client_->OnError(reason); |
| + client_->OnError(reason + " : " + last_error_message); |
| } |
| } // namespace media |