aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/capture/kms_cuda.h1
-rw-r--r--include/capture/kms_vaapi.h1
-rw-r--r--src/capture/capture.c8
-rw-r--r--src/capture/kms_vaapi.c2
-rw-r--r--src/main.cpp6
5 files changed, 6 insertions, 12 deletions
diff --git a/include/capture/kms_cuda.h b/include/capture/kms_cuda.h
index fd0d396..433e053 100644
--- a/include/capture/kms_cuda.h
+++ b/include/capture/kms_cuda.h
@@ -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;
diff --git a/include/capture/kms_vaapi.h b/include/capture/kms_vaapi.h
index 196b597..bf078b5 100644
--- a/include/capture/kms_vaapi.h
+++ b/include/capture/kms_vaapi.h
@@ -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;
diff --git a/src/capture/capture.c b/src/capture/capture.c
index ed7faa9..5e1f546 100644
--- a/src/capture/capture.c
+++ b/src/capture/capture.c
@@ -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
};
diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c
index a7e8182..b9c9ee5 100644
--- a/src/capture/kms_vaapi.c
+++ b/src/capture/kms_vaapi.c
@@ -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;
}
diff --git a/src/main.cpp b/src/main.cpp
index 3674e94..ce56373 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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.