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

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

Issue 2345163002: Several minor improvements of DirectX capturer (Closed)
Patch Set: Created 4 years, 3 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.cc
diff --git a/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc b/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc
index d7eb335fc3cf1e193da07b977424a38920b2fe6f..987fbebbb916a27cb093b6700850d2bd31d24f89 100644
--- a/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc
+++ b/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc
@@ -18,6 +18,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
+#include "webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h"
#include "webrtc/modules/desktop_capture/win/dxgi_texture_mapping.h"
#include "webrtc/modules/desktop_capture/win/dxgi_texture_staging.h"
@@ -147,7 +148,9 @@ bool DxgiOutputDuplicator::Duplicate(Context* context,
// after it has been merged to updated_region.
DesktopRegion updated_region;
updated_region.Swap(&context->updated_region);
- if (error.Error() == S_OK && frame_info.AccumulatedFrames > 0) {
+ if (error.Error() == S_OK &&
+ frame_info.AccumulatedFrames > 0 &&
+ resource) {
DetectUpdatedRegion(frame_info, offset, &context->updated_region);
if (!texture_->CopyFrom(frame_info, resource.Get(),
context->updated_region)) {

Powered by Google App Engine
This is Rietveld 408576698