Correct dimensions for touchscreen when single monitor attached

This commit is contained in:
loki
2021-05-11 23:30:56 +02:00
parent 92cd8648fa
commit 1d84c8f9ce
6 changed files with 76 additions and 22 deletions

View File

@@ -38,10 +38,6 @@ void free_buffer(AVBufferRef *ref) {
av_buffer_unref(&ref);
}
void free_packet(AVPacket *packet) {
av_packet_free(&packet);
}
namespace nv {
enum class profile_h264_e : int {
@@ -70,8 +66,6 @@ platf::pix_fmt_e map_pix_fmt(AVPixelFormat fmt);
void sw_img_to_frame(const platf::img_t &img, frame_t &frame);
void dxgi_img_to_frame(const platf::img_t &img, frame_t &frame);
util::Either<buffer_t, int> dxgi_make_hwdevice_ctx(platf::hwdevice_t *hwdevice_ctx);
void dxgi_img_to_frame(const platf::img_t &img, frame_t &frame);
util::Either<buffer_t, int> dxgi_make_hwdevice_ctx(platf::hwdevice_t *hwdevice_ctx);
util::Either<buffer_t, int> make_hwdevice_ctx(AVHWDeviceType type, void *hwdevice_ctx);
int hwframe_ctx(ctx_t &ctx, buffer_t &hwdevice, AVPixelFormat format);
@@ -183,7 +177,7 @@ public:
session_t(ctx_t &&ctx, frame_t &&frame, util::wrap_ptr<platf::hwdevice_t> &&device) :
ctx { std::move(ctx) }, frame { std::move(frame) }, device { std::move(device) } {}
session_t(session_t &&other) :
session_t(session_t &&other) noexcept :
ctx { std::move(other.ctx) }, frame { std::move(other.frame) }, device { std::move(other.device) } {}
// Ensure objects are destroyed in the correct order
@@ -862,6 +856,7 @@ encode_e encode_run_sync(std::vector<std::unique_ptr<sync_session_ctx_t>> &synce
return encode_e::error;
}
input::touch_port_event->raise(0, 0, img->width, img->height);
std::vector<sync_session_t> synced_sessions;
for(auto &ctx : synced_session_ctxs) {
auto synced_session = make_synced_session(disp.get(), encoder, *img, *ctx);
@@ -1069,6 +1064,7 @@ void capture_async(
if(display->dummy_img(dummy_img.get())) {
return;
}
input::touch_port_event->raise(0, 0, dummy_img->width, dummy_img->height);
images->raise(std::move(dummy_img));
encode_run(