aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-03-07 22:53:04 +0100
committerdec05eba <dec05eba@protonmail.com>2024-03-08 11:35:30 +0100
commit3d9a7065280e64797c5a68c794a04d60fb3f767c (patch)
tree75ad01478ec31296bf24dfd56dd1881347a54f1e /src/capture/kms.c
parent0d89378021b9e8913b521164d1bc436d9bc2630f (diff)
Set frame size to video codec context size, nicer rgb to nv12
Diffstat (limited to 'src/capture/kms.c')
-rw-r--r--src/capture/kms.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/capture/kms.c b/src/capture/kms.c
index 32e5d3e..c3ec64b 100644
--- a/src/capture/kms.c
+++ b/src/capture/kms.c
@@ -39,7 +39,7 @@ static int max_int(int a, int b) {
return a > b ? a : b;
}
-int gsr_capture_kms_start(gsr_capture_kms *self, gsr_capture_base *base, const char *display_to_capture, gsr_egl *egl, AVCodecContext *video_codec_context) {
+int gsr_capture_kms_start(gsr_capture_kms *self, gsr_capture_base *base, const char *display_to_capture, gsr_egl *egl, AVCodecContext *video_codec_context, AVFrame *frame) {
base->video_codec_context = video_codec_context;
gsr_monitor monitor;
@@ -77,6 +77,9 @@ int gsr_capture_kms_start(gsr_capture_kms *self, gsr_capture_base *base, const c
base->video_codec_context->width = max_int(2, even_number_ceil(self->capture_size.x));
base->video_codec_context->height = max_int(2, even_number_ceil(self->capture_size.y));
+
+ frame->width = base->video_codec_context->width;
+ frame->height = base->video_codec_context->height;
return 0;
}