Skip to content

Commit d21a2df

Browse files
committed
Windows DirectX grabber: add stream guard 2
Update DxGrabber.cpp
1 parent 4102786 commit d21a2df

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

sources/base/schema/schema-systemGrabber.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"type" : "boolean",
9393
"format": "checkbox",
9494
"title" : "edt_conf_stream_guard_title",
95-
"default" : true,
95+
"default" : false,
9696
"required" : true,
9797
"propertyOrder" : 27
9898
},

sources/grabber/windows/DX/DxGrabber.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,11 @@ void DxGrabber::captureFrame(DisplayHandle& display)
894894
if (_hardware)
895895
{
896896
status = deepScaledCopy(display, texDesktop);
897+
898+
if (!CHECK(status))
899+
{
900+
Error(_log, "DeepScaledCopy failed. Reason: %i", status);
901+
}
897902
}
898903
else
899904
{
@@ -915,6 +920,11 @@ void DxGrabber::captureFrame(DisplayHandle& display)
915920
_d3dContext->Unmap(display.d3dSourceTexture, 0);
916921
display.lastCapturedFrame = now;
917922
}
923+
else
924+
{
925+
Error(_log, "Cannot copy or map texture. Reason: %i. Restarting...", status);
926+
_dxRestartNow = true;
927+
}
918928

919929
SafeRelease(&texDesktop);
920930
}

0 commit comments

Comments
 (0)