diff --git a/modules/video_capture/windows/video_capture_ds.cc b/modules/video_capture/windows/video_capture_ds.cc index 778fd8761a..ea377a3b05 100644 --- a/modules/video_capture/windows/video_capture_ds.cc +++ b/modules/video_capture/windows/video_capture_ds.cc @@ -95,6 +95,10 @@ int32_t VideoCaptureDS::Init(const char* deviceUniqueIdUTF8) { } _outputCapturePin = GetOutputPin(_captureFilter, PIN_CATEGORY_CAPTURE); + if (!_outputCapturePin) { + RTC_LOG(LS_INFO) << "Failed to get output capture pin"; + return -1; + } // Create the sink filte used for receiving Captured frames. _sinkFilter = new CaptureSinkFilter(SINK_FILTER_NAME, NULL, &hr, *this); @@ -109,7 +113,12 @@ int32_t VideoCaptureDS::Init(const char* deviceUniqueIdUTF8) { RTC_LOG(LS_INFO) << "Failed to add the send filter to the graph."; return -1; } + _inputSendPin = GetInputPin(_sinkFilter); + if (!_inputSendPin) { + RTC_LOG(LS_INFO) << "Failed to get input send pin"; + return -1; + } // Temporary connect here. // This is done so that no one else can use the capture device.