Index: webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
index e22b272d145ea3a4072adc027c20c325bf9e6427..e4b3026a5991e9b10ff649443a690f77876bb8ef 100644 |
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
@@ -18,7 +18,6 @@ |
#include "webrtc/modules/desktop_capture/desktop_frame.h" |
#include "webrtc/modules/desktop_capture/desktop_frame_win.h" |
#include "webrtc/modules/desktop_capture/desktop_region.h" |
-#include "webrtc/modules/desktop_capture/differ.h" |
#include "webrtc/modules/desktop_capture/mouse_cursor.h" |
#include "webrtc/modules/desktop_capture/win/cursor.h" |
#include "webrtc/modules/desktop_capture/win/desktop.h" |
@@ -116,33 +115,13 @@ void ScreenCapturerWinMagnifier::Capture(const DesktopRegion& region) { |
return; |
} |
- const DesktopFrame* current_frame = queue_.current_frame(); |
- const DesktopFrame* last_frame = queue_.previous_frame(); |
- DesktopRegion updated_region; |
- if (last_frame && last_frame->size().equals(current_frame->size())) { |
- // Make sure the differencer is set up correctly for these previous and |
- // current screens. |
- if (!differ_.get() || (differ_->width() != current_frame->size().width()) || |
- (differ_->height() != current_frame->size().height()) || |
- (differ_->bytes_per_row() != current_frame->stride())) { |
- differ_.reset(new Differ(current_frame->size().width(), |
- current_frame->size().height(), |
- DesktopFrame::kBytesPerPixel, |
- current_frame->stride())); |
- } |
- |
- // Calculate difference between the two last captured frames. |
- differ_->CalcDirtyRegion( |
- last_frame->data(), current_frame->data(), &updated_region); |
- } else { |
- updated_region.SetRect(DesktopRect::MakeSize(current_frame->size())); |
- } |
- |
// Emit the current frame. |
std::unique_ptr<DesktopFrame> frame = queue_.current_frame()->Share(); |
frame->set_dpi(DesktopVector(GetDeviceCaps(desktop_dc_, LOGPIXELSX), |
GetDeviceCaps(desktop_dc_, LOGPIXELSY))); |
- frame->mutable_updated_region()->Swap(&updated_region); |
+ // ScreenCapturerDifferWrapper will help to detect updated region if needed. |
Sergey Ulanov
2016/09/22 18:25:08
Same here. Add a comment in screen_capturer_win_ma
Hzj_jie
2016/09/22 21:01:34
Done.
|
+ frame->mutable_updated_region()->SetRect( |
+ DesktopRect::MakeSize(frame->size())); |
frame->set_capture_time_ms((rtc::TimeNanos() - capture_start_time_nanos) / |
rtc::kNumNanosecsPerMillisec); |
callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); |