From b5d77a0c84e77b42c55deb5d07d4edf2b50cd874 Mon Sep 17 00:00:00 2001 From: Sunggook Chue Date: Tue, 12 Jul 2022 16:19:07 -0700 Subject: [PATCH] webrtc: Blank desktop capturer regards empty frame as a blank frame There is a AV where GDI capturer sends empty frame to the blank detector. It is fine operation from the GDI capturer to pass an empty to the next handler. So, blank capturer filter it and send it as blank frame to next handler. Bug: webrtc:14265 Change-Id: Ifc90a210703e14fa6d0dc7fb2ae2942ae4e8125f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268444 Reviewed-by: Alexander Cooper Commit-Queue: Alexander Cooper Cr-Commit-Position: refs/heads/main@{#37513} --- .../blank_detector_desktop_capturer_wrapper.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc b/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc index c20843414b..8e56ffc3fd 100644 --- a/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc +++ b/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc @@ -86,7 +86,13 @@ void BlankDetectorDesktopCapturerWrapper::OnCaptureResult( return; } - RTC_DCHECK(frame); + if (!frame) { + // Capturer can call the blank detector with empty frame. Blank + // detector regards it as a blank frame. + callback_->OnCaptureResult(Result::ERROR_TEMPORARY, + std::unique_ptr()); + return; + } // If nothing has been changed in current frame, we do not need to check it // again.