mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Fix texture size when recording via portal
This commit is contained in:
committed by
dec05eba
parent
313d3227d8
commit
c60783fdcb
@@ -58,6 +58,8 @@ typedef struct {
|
|||||||
uint64_t modifiers;
|
uint64_t modifiers;
|
||||||
bool using_external_image;
|
bool using_external_image;
|
||||||
gsr_monitor_rotation rotation;
|
gsr_monitor_rotation rotation;
|
||||||
|
int texture_width;
|
||||||
|
int texture_height;
|
||||||
} gsr_map_texture_output;
|
} gsr_map_texture_output;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -359,6 +359,8 @@ static int gsr_capture_portal_capture(gsr_capture *cap, gsr_capture_metadata *ca
|
|||||||
|
|
||||||
const vec2i target_pos = { max_int(0, capture_metadata->width / 2 - output_size.x / 2), max_int(0, capture_metadata->height / 2 - output_size.y / 2) };
|
const vec2i target_pos = { max_int(0, capture_metadata->width / 2 - output_size.x / 2), max_int(0, capture_metadata->height / 2 - output_size.y / 2) };
|
||||||
|
|
||||||
|
const vec2i actual_texture_size = {self->pipewire_data.texture_width, self->pipewire_data.texture_height};
|
||||||
|
|
||||||
//self->params.egl->glFlush();
|
//self->params.egl->glFlush();
|
||||||
//self->params.egl->glFinish();
|
//self->params.egl->glFinish();
|
||||||
|
|
||||||
@@ -370,7 +372,7 @@ static int gsr_capture_portal_capture(gsr_capture *cap, gsr_capture_metadata *ca
|
|||||||
|
|
||||||
gsr_color_conversion_draw(color_conversion, self->pipewire_data.using_external_image ? self->texture_map.external_texture_id : self->texture_map.texture_id,
|
gsr_color_conversion_draw(color_conversion, self->pipewire_data.using_external_image ? self->texture_map.external_texture_id : self->texture_map.texture_id,
|
||||||
target_pos, output_size,
|
target_pos, output_size,
|
||||||
(vec2i){self->pipewire_data.region.x, self->pipewire_data.region.y}, self->capture_size, self->capture_size,
|
(vec2i){self->pipewire_data.region.x, self->pipewire_data.region.y}, (vec2i){self->pipewire_data.region.width, self->pipewire_data.region.height}, actual_texture_size,
|
||||||
gsr_monitor_rotation_to_rotation(self->pipewire_data.rotation), GSR_SOURCE_COLOR_RGB, self->pipewire_data.using_external_image, fourcc_alpha);
|
gsr_monitor_rotation_to_rotation(self->pipewire_data.rotation), GSR_SOURCE_COLOR_RGB, self->pipewire_data.using_external_image, fourcc_alpha);
|
||||||
|
|
||||||
if(self->params.record_cursor && self->texture_map.cursor_texture_id > 0 && self->pipewire_data.cursor_region.width > 0) {
|
if(self->params.record_cursor && self->texture_map.cursor_texture_id > 0 && self->pipewire_data.cursor_region.width > 0) {
|
||||||
|
|||||||
@@ -871,6 +871,9 @@ bool gsr_pipewire_video_map_texture(gsr_pipewire_video *self, gsr_texture_map te
|
|||||||
|
|
||||||
gsr_pipewire_video_update_cursor_texture(self, texture_map);
|
gsr_pipewire_video_update_cursor_texture(self, texture_map);
|
||||||
|
|
||||||
|
output->texture_width = self->format.info.raw.size.width;
|
||||||
|
output->texture_height = self->format.info.raw.size.height;
|
||||||
|
|
||||||
output->region.x = 0;
|
output->region.x = 0;
|
||||||
output->region.y = 0;
|
output->region.y = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user