mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-04-19 00:15:48 +09:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb8104d107 | ||
|
|
7b64f10eaf |
@@ -1,4 +1,4 @@
|
|||||||
project('gpu-screen-recorder', ['c', 'cpp'], version : '5.7.1', default_options : ['warning_level=2'])
|
project('gpu-screen-recorder', ['c', 'cpp'], version : '5.7.2', default_options : ['warning_level=2'])
|
||||||
|
|
||||||
add_project_arguments('-Wshadow', language : ['c', 'cpp'])
|
add_project_arguments('-Wshadow', language : ['c', 'cpp'])
|
||||||
if get_option('buildtype') == 'debug'
|
if get_option('buildtype') == 'debug'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gpu-screen-recorder"
|
name = "gpu-screen-recorder"
|
||||||
type = "executable"
|
type = "executable"
|
||||||
version = "5.7.1"
|
version = "5.7.2"
|
||||||
platforms = ["posix"]
|
platforms = ["posix"]
|
||||||
|
|
||||||
[config]
|
[config]
|
||||||
|
|||||||
@@ -622,7 +622,6 @@ static int gsr_capture_kms_capture(gsr_capture *cap, gsr_capture_metadata *captu
|
|||||||
gsr_kms_set_hdr_metadata(self, drm_fd);
|
gsr_kms_set_hdr_metadata(self, drm_fd);
|
||||||
|
|
||||||
self->capture_size = rotate_capture_size_if_rotated(self, (vec2i){ drm_fd->crtc_w, drm_fd->crtc_h });
|
self->capture_size = rotate_capture_size_if_rotated(self, (vec2i){ drm_fd->crtc_w, drm_fd->crtc_h });
|
||||||
const vec2i original_frame_size = self->capture_size;
|
|
||||||
if(self->params.region_size.x > 0 && self->params.region_size.y > 0)
|
if(self->params.region_size.x > 0 && self->params.region_size.y > 0)
|
||||||
self->capture_size = self->params.region_size;
|
self->capture_size = self->params.region_size;
|
||||||
|
|
||||||
@@ -654,7 +653,7 @@ static int gsr_capture_kms_capture(gsr_capture *cap, gsr_capture_metadata *captu
|
|||||||
|
|
||||||
gsr_color_conversion_draw(color_conversion, self->external_texture_fallback ? self->external_input_texture_id : self->input_texture_id,
|
gsr_color_conversion_draw(color_conversion, self->external_texture_fallback ? self->external_input_texture_id : self->input_texture_id,
|
||||||
target_pos, output_size,
|
target_pos, output_size,
|
||||||
capture_pos, self->capture_size, original_frame_size,
|
capture_pos, self->capture_size, (vec2i){ drm_fd->width, drm_fd->height },
|
||||||
gsr_monitor_rotation_to_rotation(rotation), GSR_SOURCE_COLOR_RGB, self->external_texture_fallback, false);
|
gsr_monitor_rotation_to_rotation(rotation), GSR_SOURCE_COLOR_RGB, self->external_texture_fallback, false);
|
||||||
|
|
||||||
if(self->params.record_cursor) {
|
if(self->params.record_cursor) {
|
||||||
|
|||||||
@@ -476,7 +476,10 @@ static void gsr_color_conversion_swizzle_reset(gsr_color_conversion *self, gsr_s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsigned int texture_id, bool external_texture, float rotation_matrix[2][2], vec2i source_position, vec2i source_size, vec2i destination_pos, vec2i texture_size, vec2f scale, gsr_source_color source_color) {
|
static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsigned int texture_id, bool external_texture, gsr_rotation rotation, float rotation_matrix[2][2], vec2i source_position, vec2i source_size, vec2i destination_pos, vec2i texture_size, vec2f scale, gsr_source_color source_color) {
|
||||||
|
if(source_size.x == 0 || source_size.y == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
const vec2i dest_texture_size = self->params.destination_textures_size[0];
|
const vec2i dest_texture_size = self->params.destination_textures_size[0];
|
||||||
const int texture_target = external_texture ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D;
|
const int texture_target = external_texture ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D;
|
||||||
|
|
||||||
@@ -498,11 +501,18 @@ static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsig
|
|||||||
(float)source_position.y / (texture_size.y == 0 ? 1.0f : (float)texture_size.y),
|
(float)source_position.y / (texture_size.y == 0 ? 1.0f : (float)texture_size.y),
|
||||||
};
|
};
|
||||||
|
|
||||||
const vec2f texture_size_norm = {
|
vec2f texture_size_norm = {
|
||||||
(float)source_size.x / (texture_size.x == 0 ? 1.0f : (float)texture_size.x),
|
(float)source_size.x / (texture_size.x == 0 ? 1.0f : (float)texture_size.x),
|
||||||
(float)source_size.y / (texture_size.y == 0 ? 1.0f : (float)texture_size.y),
|
(float)source_size.y / (texture_size.y == 0 ? 1.0f : (float)texture_size.y),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(rotation == GSR_ROT_90 || rotation == GSR_ROT_270) {
|
||||||
|
const float ratio_x = (double)source_size.x / (double)source_size.y;
|
||||||
|
const float ratio_y = (double)source_size.y / (double)source_size.x;
|
||||||
|
texture_size_norm.x *= ratio_y;
|
||||||
|
texture_size_norm.y *= ratio_x;
|
||||||
|
}
|
||||||
|
|
||||||
const float vertices[] = {
|
const float vertices[] = {
|
||||||
-1.0f + 0.0f, -1.0f + 0.0f + size_norm.y, texture_pos_norm.x, texture_pos_norm.y + texture_size_norm.y,
|
-1.0f + 0.0f, -1.0f + 0.0f + size_norm.y, texture_pos_norm.x, texture_pos_norm.y + texture_size_norm.y,
|
||||||
-1.0f + 0.0f, -1.0f + 0.0f, texture_pos_norm.x, texture_pos_norm.y,
|
-1.0f + 0.0f, -1.0f + 0.0f, texture_pos_norm.x, texture_pos_norm.y,
|
||||||
@@ -585,7 +595,7 @@ void gsr_color_conversion_draw(gsr_color_conversion *self, unsigned int texture_
|
|||||||
|
|
||||||
source_position.x += source_pos.x;
|
source_position.x += source_pos.x;
|
||||||
source_position.y += source_pos.y;
|
source_position.y += source_pos.y;
|
||||||
gsr_color_conversion_draw_graphics(self, texture_id, external_texture, rotation_matrix, source_position, source_size, destination_pos, texture_size, scale, source_color);
|
gsr_color_conversion_draw_graphics(self, texture_id, external_texture, rotation, rotation_matrix, source_position, source_size, destination_pos, texture_size, scale, source_color);
|
||||||
|
|
||||||
self->params.egl->glFlush();
|
self->params.egl->glFlush();
|
||||||
// TODO: Use the minimal barrier required
|
// TODO: Use the minimal barrier required
|
||||||
|
|||||||
Reference in New Issue
Block a user