Re-enable intel arc fix (but only for intel systems)

This commit is contained in:
dec05eba
2024-06-10 16:55:47 +02:00
parent e4832f3d64
commit f02f5a9d00
5 changed files with 6 additions and 12 deletions

View File

@@ -9,7 +9,6 @@
typedef struct { typedef struct {
gsr_egl *egl; gsr_egl *egl;
const char *display_to_capture; /* if this is "screen", then the first monitor is captured. A copy is made of this */ 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; bool hdr;
gsr_color_range color_range; gsr_color_range color_range;
bool record_cursor; bool record_cursor;

View File

@@ -9,7 +9,6 @@
typedef struct { typedef struct {
gsr_egl *egl; gsr_egl *egl;
const char *display_to_capture; /* if this is "screen", then the first monitor is captured. A copy is made of this */ 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; bool hdr;
gsr_color_range color_range; gsr_color_range color_range;
bool record_cursor; bool record_cursor;

View File

@@ -116,8 +116,7 @@ bool gsr_capture_base_setup_vaapi_textures(gsr_capture_base *self, AVFrame *fram
const int layer = i; const int layer = i;
const int plane = 0; 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[] = { const intptr_t img_attr[] = {
EGL_LINUX_DRM_FOURCC_EXT, formats[i], EGL_LINUX_DRM_FOURCC_EXT, formats[i],
EGL_WIDTH, prime->width / div[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_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_OFFSET_EXT, prime->layers[layer].offset[plane],
EGL_DMA_BUF_PLANE0_PITCH_EXT, prime->layers[layer].pitch[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_LO_EXT, modifier & 0xFFFFFFFFULL, EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, modifier >> 32ULL,
//EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, modifier >> 32ULL,
EGL_NONE EGL_NONE
}; };

View File

@@ -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) { static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) {
gsr_capture_kms_vaapi *cap_kms = cap->priv; 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; return 0;
} }

View File

@@ -1465,7 +1465,7 @@ static void list_supported_video_codecs() {
XCloseDisplay(dpy); 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 }; vec2i region_size = { 0, 0 };
Window src_window_id = None; Window src_window_id = None;
bool follow_focused = false; 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; gsr_capture_kms_cuda_params kms_params;
kms_params.egl = &egl; kms_params.egl = &egl;
kms_params.display_to_capture = window_str; kms_params.display_to_capture = window_str;
kms_params.gpu_inf = gpu_inf;
kms_params.hdr = video_codec_is_hdr(video_codec); kms_params.hdr = video_codec_is_hdr(video_codec);
kms_params.color_range = color_range; kms_params.color_range = color_range;
kms_params.record_cursor = record_cursor; 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; gsr_capture_kms_vaapi_params kms_params;
kms_params.egl = &egl; kms_params.egl = &egl;
kms_params.display_to_capture = window_str; kms_params.display_to_capture = window_str;
kms_params.gpu_inf = gpu_inf;
kms_params.hdr = video_codec_is_hdr(video_codec); kms_params.hdr = video_codec_is_hdr(video_codec);
kms_params.color_range = color_range; kms_params.color_range = color_range;
kms_params.record_cursor = record_cursor; kms_params.record_cursor = record_cursor;
@@ -2318,7 +2316,7 @@ int main(int argc, char **argv) {
_exit(2); _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. // (Some?) livestreaming services require at least one audio track to work.
// If not audio is provided then create one silent audio track. // If not audio is provided then create one silent audio track.