Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Unified Diff: webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h

Issue 2268093002: [WebRTC] A real ScreenCapturer test (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Resolve review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h
diff --git a/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h b/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h
index 31fb32ab9e53fb22bc9f674c5f86c645bd2cf609..b98273922c2105e44441126287b7fdefcf9eef14 100644
--- a/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h
+++ b/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h
@@ -21,9 +21,9 @@
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/thread_annotations.h"
-#include "webrtc/modules/desktop_capture/desktop_frame.h"
#include "webrtc/modules/desktop_capture/desktop_geometry.h"
#include "webrtc/modules/desktop_capture/desktop_region.h"
+#include "webrtc/modules/desktop_capture/shared_desktop_frame.h"
#include "webrtc/modules/desktop_capture/win/d3d_device.h"
#include "webrtc/modules/desktop_capture/win/dxgi_texture.h"
@@ -60,17 +60,15 @@ class DxgiOutputDuplicator {
// Copies the content of current IDXGIOutput to the |target|. To improve the
// performance, this function copies only regions merged from
- // |last_frame|.updated_region and DetectUpdatedRegion(). The |offset| decides
- // the
- // offset in the |target| where the content should be copied to. i.e. this
- // function copies the content to the rectangle of (offset.x(), offset.y()) to
+ // |context|->updated_region and DetectUpdatedRegion(). The |offset|
+ // decides the offset in the |target| where the content should be copied to.
+ // i.e. this function copies the content to the rectangle of
+ // (offset.x(), offset.y()) to
// (offset.x() + desktop_rect_.width(), offset.y() + desktop_rect_.height()).
- // The |last_frame| is always expected to be translated by the same offset.
// Returns false in case of a failure.
bool Duplicate(Context* context,
- const DesktopFrame* last_frame,
const DesktopVector offset,
- DesktopFrame* target);
+ SharedDesktopFrame* target);
// Returns the desktop rect covered by this DxgiOutputDuplicator.
DesktopRect desktop_rect() const { return desktop_rect_; }
@@ -121,6 +119,12 @@ class DxgiOutputDuplicator {
// change this time. And during next Duplicate() function call, their
// updated_region_ will be merged and copied.
std::vector<Context*> contexts_;
+
+ // The last full frame of this output and its offset. If one
+ // AcquireNextFrame() failed because of timeout, i.e. no update, we can copy
+ // content from |last_frame_|.
+ std::unique_ptr<SharedDesktopFrame> last_frame_;
+ DesktopVector last_frame_offset_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698