aboutsummaryrefslogtreecommitdiff
path: root/include/capture/kms.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-05 01:59:04 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-05 10:33:47 +0200
commitb9fa7f2fa25ee37c87077bce468c95e48fce5c18 (patch)
tree3aff293110d8405e8057edb9c757f6e630c22de2 /include/capture/kms.h
parent62d61fda12e3774fee6b671e44fb89bd2ef8da8c (diff)
Separate video encoding method from capture method
With this instead of kms_cuda/kms_vaapi/kms_software and xcomposite_cuda/xcomposite_vaapi/xcomposite_software there is now only kms and xcomposite.
Diffstat (limited to 'include/capture/kms.h')
-rw-r--r--include/capture/kms.h50
1 files changed, 8 insertions, 42 deletions
diff --git a/include/capture/kms.h b/include/capture/kms.h
index 674813a..278a391 100644
--- a/include/capture/kms.h
+++ b/include/capture/kms.h
@@ -2,49 +2,15 @@
#define GSR_CAPTURE_KMS_H
#include "capture.h"
-#include "../../kms/client/kms_client.h"
-#include "../color_conversion.h"
-#include "../vec2.h"
-#include "../defs.h"
-#include <stdbool.h>
-
-typedef struct AVCodecContext AVCodecContext;
-typedef struct AVMasteringDisplayMetadata AVMasteringDisplayMetadata;
-typedef struct AVContentLightMetadata AVContentLightMetadata;
-typedef struct gsr_capture_kms gsr_capture_kms;
-typedef struct gsr_egl gsr_egl;
-typedef struct AVFrame AVFrame;
-
-#define MAX_CONNECTOR_IDS 32
typedef struct {
- uint32_t connector_ids[MAX_CONNECTOR_IDS];
- int num_connector_ids;
-} MonitorId;
-
-struct gsr_capture_kms {
- gsr_capture_base base;
-
- bool should_stop;
- bool stop_is_error;
-
- gsr_kms_client kms_client;
- gsr_kms_response kms_response;
-
- vec2i capture_pos;
- vec2i capture_size;
- MonitorId monitor_id;
-
- AVMasteringDisplayMetadata *mastering_display_metadata;
- AVContentLightMetadata *light_metadata;
-
- gsr_monitor_rotation monitor_rotation;
-};
-
-/* Returns 0 on success */
-int gsr_capture_kms_start(gsr_capture_kms *self, const char *display_to_capture, gsr_egl *egl, AVCodecContext *video_codec_context, AVFrame *frame);
-void gsr_capture_kms_stop(gsr_capture_kms *self);
-bool gsr_capture_kms_capture(gsr_capture_kms *self, AVFrame *frame, bool hdr, bool screen_plane_use_modifiers, bool cursor_texture_is_external, bool record_cursor);
-void gsr_capture_kms_cleanup_kms_fds(gsr_capture_kms *self);
+ 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_color_range color_range;
+ bool hdr;
+ bool record_cursor;
+} gsr_capture_kms_params;
+
+gsr_capture* gsr_capture_kms_create(const gsr_capture_kms_params *params);
#endif /* GSR_CAPTURE_KMS_H */