aboutsummaryrefslogtreecommitdiff
path: root/include/capture
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-04 01:35:03 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-04 01:35:03 +0200
commit62d61fda12e3774fee6b671e44fb89bd2ef8da8c (patch)
treed5050689876d9adbe51bdf137475b3c3bc332c63 /include/capture
parentea7b58d7f92b179a4c2717237422e1200b5be673 (diff)
Add support for software video encoding with '-encoder cpu' option, currently h264 only
Diffstat (limited to 'include/capture')
-rw-r--r--include/capture/capture.h3
-rw-r--r--include/capture/kms_software.h19
-rw-r--r--include/capture/nvfbc.h1
-rw-r--r--include/capture/xcomposite_software.h13
4 files changed, 35 insertions, 1 deletions
diff --git a/include/capture/capture.h b/include/capture/capture.h
index fbbe767..8c654f4 100644
--- a/include/capture/capture.h
+++ b/include/capture/capture.h
@@ -62,9 +62,10 @@ void gsr_capture_destroy(gsr_capture *cap, AVCodecContext *video_codec_context);
bool gsr_capture_base_setup_vaapi_textures(gsr_capture_base *self, AVFrame *frame, VADisplay va_dpy, VADRMPRIMESurfaceDescriptor *prime, gsr_color_range color_range);
bool gsr_capture_base_setup_cuda_textures(gsr_capture_base *self, AVFrame *frame, gsr_cuda_context *cuda_context, gsr_color_range color_range, gsr_source_color source_color, bool hdr);
+bool gsr_capture_base_setup_textures(gsr_capture_base *self, AVFrame *frame, gsr_color_range color_range, gsr_source_color source_color, bool hdr, bool cursor_texture_is_external);
void gsr_capture_base_stop(gsr_capture_base *self);
-bool drm_create_codec_context(const char *card_path, AVCodecContext *video_codec_context, int width, int height, bool hdr, VADisplay *va_dpy);
+bool vaapi_create_codec_context(const char *card_path, AVCodecContext *video_codec_context, int width, int height, bool hdr, VADisplay *va_dpy);
bool cuda_create_codec_context(CUcontext cu_ctx, AVCodecContext *video_codec_context, int width, int height, bool hdr, CUstream *cuda_stream);
#endif /* GSR_CAPTURE_CAPTURE_H */
diff --git a/include/capture/kms_software.h b/include/capture/kms_software.h
new file mode 100644
index 0000000..f9b57f3
--- /dev/null
+++ b/include/capture/kms_software.h
@@ -0,0 +1,19 @@
+#ifndef GSR_CAPTURE_KMS_SOFTWARE_H
+#define GSR_CAPTURE_KMS_SOFTWARE_H
+
+#include "../vec2.h"
+#include "../utils.h"
+#include "../color_conversion.h"
+#include "capture.h"
+
+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 */
+ bool hdr;
+ gsr_color_range color_range;
+ bool record_cursor;
+} gsr_capture_kms_software_params;
+
+gsr_capture* gsr_capture_kms_software_create(const gsr_capture_kms_software_params *params);
+
+#endif /* GSR_CAPTURE_KMS_SOFTWARE_H */
diff --git a/include/capture/nvfbc.h b/include/capture/nvfbc.h
index 36bc2b6..e24b712 100644
--- a/include/capture/nvfbc.h
+++ b/include/capture/nvfbc.h
@@ -15,6 +15,7 @@ typedef struct {
bool hdr;
gsr_color_range color_range;
bool record_cursor;
+ bool use_software_video_encoder;
} gsr_capture_nvfbc_params;
gsr_capture* gsr_capture_nvfbc_create(const gsr_capture_nvfbc_params *params);
diff --git a/include/capture/xcomposite_software.h b/include/capture/xcomposite_software.h
new file mode 100644
index 0000000..d41083c
--- /dev/null
+++ b/include/capture/xcomposite_software.h
@@ -0,0 +1,13 @@
+#ifndef GSR_CAPTURE_XCOMPOSITE_SOFTWARE_H
+#define GSR_CAPTURE_XCOMPOSITE_SOFTWARE_H
+
+#include "capture.h"
+#include "xcomposite.h"
+
+typedef struct {
+ gsr_capture_xcomposite_params base;
+} gsr_capture_xcomposite_software_params;
+
+gsr_capture* gsr_capture_xcomposite_software_create(const gsr_capture_xcomposite_software_params *params);
+
+#endif /* GSR_CAPTURE_XCOMPOSITE_SOFTWARE_H */