diff options
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | src/capture/kms.c | 21 | ||||
-rw-r--r-- | src/capture/xcomposite.c | 20 |
3 files changed, 7 insertions, 38 deletions
@@ -135,4 +135,6 @@ Enable b-frames. Support vfr matching games exact fps all the time. On x11 use damage tracking, on wayland? maybe there is drm plane damage tracking. But that may not be accurate as the compositor may update it every monitor hz anyways. On wayland maybe only support it for desktop portal + pipewire capture. Support selecting which gpu to use. This can be done in egl with eglQueryDevicesEXT and then eglGetPlatformDisplayEXT. This will automatically work on AMD and Intel as vaapi uses the same device. On nvidia we need to use eglQueryDeviceAttribEXT with EGL_CUDA_DEVICE_NV. - Maybe on glx (nvidia x11 nvfbc) we need to use __NV_PRIME_RENDER_OFFLOAD_PROVIDER and __GLX_VENDOR_LIBRARY_NAME instead.
\ No newline at end of file + Maybe on glx (nvidia x11 nvfbc) we need to use __NV_PRIME_RENDER_OFFLOAD_PROVIDER and __GLX_VENDOR_LIBRARY_NAME instead. + +Remove is_damaged and clear_damage and return a value from capture function instead that states if the image has been updated or not. diff --git a/src/capture/kms.c b/src/capture/kms.c index ec83cab..ebc7f17 100644 --- a/src/capture/kms.c +++ b/src/capture/kms.c @@ -77,25 +77,8 @@ int gsr_capture_kms_start(gsr_capture_kms *self, const char *display_to_capture, /* Disable vsync */ egl->eglSwapInterval(egl->egl_display, 0); - // TODO: Move this and xcomposite equivalent to a common section unrelated to capture method - if(egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && video_codec_context->codec_id == AV_CODEC_ID_HEVC) { - // TODO: dont do this if using ffmpeg reports that this is not needed (AMD driver bug that was fixed recently) - self->base.video_codec_context->width = FFALIGN(self->capture_size.x, 64); - self->base.video_codec_context->height = FFALIGN(self->capture_size.y, 16); - } else if(egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && video_codec_context->codec_id == AV_CODEC_ID_AV1) { - // TODO: Dont do this for VCN 5 and forward which should fix this hardware bug - self->base.video_codec_context->width = FFALIGN(self->capture_size.x, 64); - // AMD driver has special case handling for 1080 height to set it to 1082 instead of 1088 (1080 aligned to 16). - // TODO: Set height to 1082 in this case, but it wont work because it will be aligned to 1088. - if(self->capture_size.y == 1080) { - self->base.video_codec_context->height = 1080; - } else { - self->base.video_codec_context->height = FFALIGN(self->capture_size.y, 16); - } - } else { - self->base.video_codec_context->width = FFALIGN(self->capture_size.x, 2); - self->base.video_codec_context->height = FFALIGN(self->capture_size.y, 2); - } + self->base.video_codec_context->width = FFALIGN(self->capture_size.x, 2); + self->base.video_codec_context->height = FFALIGN(self->capture_size.y, 2); frame->width = self->base.video_codec_context->width; frame->height = self->base.video_codec_context->height; diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c index 3240ed8..edb1f41 100644 --- a/src/capture/xcomposite.c +++ b/src/capture/xcomposite.c @@ -135,24 +135,8 @@ int gsr_capture_xcomposite_start(gsr_capture_xcomposite *self, AVCodecContext *v if(self->params.region_size.x > 0 && self->params.region_size.y > 0) video_size = self->params.region_size; - if(self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && video_codec_context->codec_id == AV_CODEC_ID_HEVC) { - // TODO: dont do this if using ffmpeg reports that this is not needed (AMD driver bug that was fixed recently) - video_codec_context->width = FFALIGN(video_size.x, 64); - video_codec_context->height = FFALIGN(video_size.y, 16); - } else if(self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && video_codec_context->codec_id == AV_CODEC_ID_AV1) { - // TODO: Dont do this for VCN 5 and forward which should fix this hardware bug - video_codec_context->width = FFALIGN(video_size.x, 64); - // AMD driver has special case handling for 1080 height to set it to 1082 instead of 1088 (1080 aligned to 16). - // TODO: Set height to 1082 in this case, but it wont work because it will be aligned to 1088. - if(video_size.y == 1080) { - video_codec_context->height = 1080; - } else { - video_codec_context->height = FFALIGN(video_size.y, 16); - } - } else { - video_codec_context->width = FFALIGN(video_size.x, 2); - video_codec_context->height = FFALIGN(video_size.y, 2); - } + video_codec_context->width = FFALIGN(video_size.x, 2); + video_codec_context->height = FFALIGN(video_size.y, 2); frame->width = video_codec_context->width; frame->height = video_codec_context->height; |