Release duplication frame after snapshot
This commit is contained in:
@@ -74,19 +74,20 @@ namespace platf::dxgi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto status = dup->ReleaseFrame();
|
auto status = dup->ReleaseFrame();
|
||||||
|
has_frame = false;
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case S_OK:
|
case S_OK:
|
||||||
has_frame = false;
|
|
||||||
return capture_e::ok;
|
return capture_e::ok;
|
||||||
case DXGI_ERROR_WAIT_TIMEOUT:
|
|
||||||
return capture_e::timeout;
|
case DXGI_ERROR_INVALID_CALL:
|
||||||
case WAIT_ABANDONED:
|
BOOST_LOG(warning) << "Duplication frame already released";
|
||||||
|
return capture_e::ok;
|
||||||
|
|
||||||
case DXGI_ERROR_ACCESS_LOST:
|
case DXGI_ERROR_ACCESS_LOST:
|
||||||
case DXGI_ERROR_ACCESS_DENIED:
|
|
||||||
has_frame = false;
|
|
||||||
return capture_e::reinit;
|
return capture_e::reinit;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BOOST_LOG(error) << "Couldn't release frame [0x"sv << util::hex(status).to_string_view();
|
BOOST_LOG(error) << "Error while releasing duplication frame [0x"sv << util::hex(status).to_string_view();
|
||||||
return capture_e::error;
|
return capture_e::error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,6 +175,11 @@ namespace platf::dxgi {
|
|||||||
BOOST_LOG(error) << "Unrecognized capture status ["sv << (int) status << ']';
|
BOOST_LOG(error) << "Unrecognized capture status ["sv << (int) status << ']';
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status = dup.release_frame();
|
||||||
|
if (status != platf::capture_e::ok) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return capture_e::ok;
|
return capture_e::ok;
|
||||||
|
|||||||
Reference in New Issue
Block a user