Release duplication frame after snapshot
This commit is contained in:
parent
730fce4b1c
commit
42a77b247e
1 changed files with 13 additions and 7 deletions
|
|
@ -74,19 +74,20 @@ namespace platf::dxgi {
|
|||
}
|
||||
|
||||
auto status = dup->ReleaseFrame();
|
||||
has_frame = false;
|
||||
switch (status) {
|
||||
case S_OK:
|
||||
has_frame = false;
|
||||
return capture_e::ok;
|
||||
case DXGI_ERROR_WAIT_TIMEOUT:
|
||||
return capture_e::timeout;
|
||||
case WAIT_ABANDONED:
|
||||
|
||||
case DXGI_ERROR_INVALID_CALL:
|
||||
BOOST_LOG(warning) << "Duplication frame already released";
|
||||
return capture_e::ok;
|
||||
|
||||
case DXGI_ERROR_ACCESS_LOST:
|
||||
case DXGI_ERROR_ACCESS_DENIED:
|
||||
has_frame = false;
|
||||
return capture_e::reinit;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -174,6 +175,11 @@ namespace platf::dxgi {
|
|||
BOOST_LOG(error) << "Unrecognized capture status ["sv << (int) status << ']';
|
||||
return status;
|
||||
}
|
||||
|
||||
status = dup.release_frame();
|
||||
if (status != platf::capture_e::ok) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
return capture_e::ok;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue