Decrease normal capture buffer to single image

This commit is contained in:
ns6089
2023-03-29 18:07:20 +03:00
committed by Cameron Gutman
parent 191b929ab0
commit eed27d3c0a
12 changed files with 333 additions and 145 deletions

View File

@@ -171,9 +171,7 @@ namespace platf::dxgi {
}
capture_e
display_ram_t::snapshot(::platf::img_t *img_base, std::chrono::milliseconds timeout, bool cursor_visible) {
auto img = (img_t *) img_base;
display_ram_t::snapshot(const pull_free_image_cb_t &pull_free_image_cb, std::shared_ptr<platf::img_t> &img_out, std::chrono::milliseconds timeout, bool cursor_visible) {
HRESULT status;
DXGI_OUTDUPL_FRAME_INFO frame_info;
@@ -269,6 +267,11 @@ namespace platf::dxgi {
}
}
if (!pull_free_image_cb(img_out)) {
return capture_e::interrupted;
}
auto img = (img_t *) img_out.get();
// If we don't know the final capture format yet, encode a dummy image
if (capture_format == DXGI_FORMAT_UNKNOWN) {
BOOST_LOG(debug) << "Capture format is still unknown. Encoding a blank image"sv;