mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Re-enable intel arc fix (but only for intel systems)
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
typedef struct {
|
||||
gsr_egl *egl;
|
||||
const char *display_to_capture; /* if this is "screen", then the first monitor is captured. A copy is made of this */
|
||||
gsr_gpu_info gpu_inf;
|
||||
bool hdr;
|
||||
gsr_color_range color_range;
|
||||
bool record_cursor;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
typedef struct {
|
||||
gsr_egl *egl;
|
||||
const char *display_to_capture; /* if this is "screen", then the first monitor is captured. A copy is made of this */
|
||||
gsr_gpu_info gpu_inf;
|
||||
bool hdr;
|
||||
gsr_color_range color_range;
|
||||
bool record_cursor;
|
||||
|
||||
@@ -116,8 +116,7 @@ bool gsr_capture_base_setup_vaapi_textures(gsr_capture_base *self, AVFrame *fram
|
||||
const int layer = i;
|
||||
const int plane = 0;
|
||||
|
||||
//const uint64_t modifier = prime->objects[prime->layers[layer].object_index[plane]].drm_format_modifier;
|
||||
|
||||
const uint64_t modifier = prime->objects[prime->layers[layer].object_index[plane]].drm_format_modifier;
|
||||
const intptr_t img_attr[] = {
|
||||
EGL_LINUX_DRM_FOURCC_EXT, formats[i],
|
||||
EGL_WIDTH, prime->width / div[i],
|
||||
@@ -125,9 +124,8 @@ bool gsr_capture_base_setup_vaapi_textures(gsr_capture_base *self, AVFrame *fram
|
||||
EGL_DMA_BUF_PLANE0_FD_EXT, prime->objects[prime->layers[layer].object_index[plane]].fd,
|
||||
EGL_DMA_BUF_PLANE0_OFFSET_EXT, prime->layers[layer].offset[plane],
|
||||
EGL_DMA_BUF_PLANE0_PITCH_EXT, prime->layers[layer].pitch[plane],
|
||||
// TODO:
|
||||
//EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT, modifier & 0xFFFFFFFFULL,
|
||||
//EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, modifier >> 32ULL,
|
||||
EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT, modifier & 0xFFFFFFFFULL,
|
||||
EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, modifier >> 32ULL,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ static bool gsr_capture_kms_vaapi_should_stop(gsr_capture *cap, bool *err) {
|
||||
|
||||
static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) {
|
||||
gsr_capture_kms_vaapi *cap_kms = cap->priv;
|
||||
gsr_capture_kms_capture(&cap_kms->kms, frame, cap_kms->params.hdr, false, false, cap_kms->params.record_cursor);
|
||||
gsr_capture_kms_capture(&cap_kms->kms, frame, cap_kms->params.hdr, cap_kms->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_INTEL, false, cap_kms->params.record_cursor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1465,7 +1465,7 @@ static void list_supported_video_codecs() {
|
||||
XCloseDisplay(dpy);
|
||||
}
|
||||
|
||||
static gsr_capture* create_capture_impl(const char *window_str, const char *screen_region, bool wayland, gsr_gpu_info gpu_inf, gsr_egl &egl, int fps, bool overclock, VideoCodec video_codec, gsr_color_range color_range, bool record_cursor) {
|
||||
static gsr_capture* create_capture_impl(const char *window_str, const char *screen_region, bool wayland, gsr_egl &egl, int fps, bool overclock, VideoCodec video_codec, gsr_color_range color_range, bool record_cursor) {
|
||||
vec2i region_size = { 0, 0 };
|
||||
Window src_window_id = None;
|
||||
bool follow_focused = false;
|
||||
@@ -1535,7 +1535,6 @@ static gsr_capture* create_capture_impl(const char *window_str, const char *scre
|
||||
gsr_capture_kms_cuda_params kms_params;
|
||||
kms_params.egl = &egl;
|
||||
kms_params.display_to_capture = window_str;
|
||||
kms_params.gpu_inf = gpu_inf;
|
||||
kms_params.hdr = video_codec_is_hdr(video_codec);
|
||||
kms_params.color_range = color_range;
|
||||
kms_params.record_cursor = record_cursor;
|
||||
@@ -1576,7 +1575,6 @@ static gsr_capture* create_capture_impl(const char *window_str, const char *scre
|
||||
gsr_capture_kms_vaapi_params kms_params;
|
||||
kms_params.egl = &egl;
|
||||
kms_params.display_to_capture = window_str;
|
||||
kms_params.gpu_inf = gpu_inf;
|
||||
kms_params.hdr = video_codec_is_hdr(video_codec);
|
||||
kms_params.color_range = color_range;
|
||||
kms_params.record_cursor = record_cursor;
|
||||
@@ -2318,7 +2316,7 @@ int main(int argc, char **argv) {
|
||||
_exit(2);
|
||||
}
|
||||
|
||||
gsr_capture *capture = create_capture_impl(window_str, screen_region, wayland, egl.gpu_info, egl, fps, overclock, video_codec, color_range, record_cursor);
|
||||
gsr_capture *capture = create_capture_impl(window_str, screen_region, wayland, egl, fps, overclock, video_codec, color_range, record_cursor);
|
||||
|
||||
// (Some?) livestreaming services require at least one audio track to work.
|
||||
// If not audio is provided then create one silent audio track.
|
||||
|
||||
Reference in New Issue
Block a user