| Index: webrtc/modules/desktop_capture/cropping_window_capturer.cc
|
| diff --git a/webrtc/modules/desktop_capture/cropping_window_capturer.cc b/webrtc/modules/desktop_capture/cropping_window_capturer.cc
|
| index cbe7d96e5d637d579799cdf1581a76ef48ed5cd1..50aaeea0308d404c2335438d63c8d03472d0def9 100644
|
| --- a/webrtc/modules/desktop_capture/cropping_window_capturer.cc
|
| +++ b/webrtc/modules/desktop_capture/cropping_window_capturer.cc
|
| @@ -74,31 +74,31 @@ bool CroppingWindowCapturer::BringSelectedWindowToFront() {
|
| return window_capturer_->BringSelectedWindowToFront();
|
| }
|
|
|
| -void CroppingWindowCapturer::OnCaptureCompleted(DesktopFrame* frame) {
|
| - std::unique_ptr<DesktopFrame> screen_frame(frame);
|
| -
|
| +void CroppingWindowCapturer::OnCaptureResult(
|
| + DesktopCapturer::Result result,
|
| + std::unique_ptr<DesktopFrame> screen_frame) {
|
| if (!ShouldUseScreenCapturer()) {
|
| LOG(LS_INFO) << "Window no longer on top when ScreenCapturer finishes";
|
| window_capturer_->Capture(DesktopRegion());
|
| return;
|
| }
|
|
|
| - if (!frame) {
|
| + if (result != Result::SUCCESS) {
|
| LOG(LS_WARNING) << "ScreenCapturer failed to capture a frame";
|
| - callback_->OnCaptureCompleted(NULL);
|
| + callback_->OnCaptureResult(result, nullptr);
|
| return;
|
| }
|
|
|
| DesktopRect window_rect = GetWindowRectInVirtualScreen();
|
| if (window_rect.is_empty()) {
|
| LOG(LS_WARNING) << "Window rect is empty";
|
| - callback_->OnCaptureCompleted(NULL);
|
| + callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
|
| return;
|
| }
|
|
|
| - std::unique_ptr<DesktopFrame> window_frame(
|
| - CreateCroppedDesktopFrame(screen_frame.release(), window_rect));
|
| - callback_->OnCaptureCompleted(window_frame.release());
|
| + callback_->OnCaptureResult(
|
| + Result::SUCCESS,
|
| + CreateCroppedDesktopFrame(std::move(screen_frame), window_rect));
|
| }
|
|
|
| #if !defined(WEBRTC_WIN)
|
|
|