Refactor capture base

This commit is contained in:
dec05eba
2024-03-09 18:54:53 +01:00
parent a3fedae329
commit 45ad3695b6
12 changed files with 145 additions and 160 deletions

View File

@@ -1,13 +1,13 @@
#ifndef GSR_CAPTURE_KMS_H
#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 gsr_capture_base gsr_capture_base;
typedef struct AVCodecContext AVCodecContext;
typedef struct AVMasteringDisplayMetadata AVMasteringDisplayMetadata;
typedef struct AVContentLightMetadata AVContentLightMetadata;
@@ -23,6 +23,8 @@ typedef struct {
} MonitorId;
struct gsr_capture_kms {
gsr_capture_base base;
bool should_stop;
bool stop_is_error;
@@ -40,9 +42,9 @@ struct gsr_capture_kms {
};
/* Returns 0 on success */
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);
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, gsr_capture_base *base, AVFrame *frame, gsr_egl *egl, bool hdr, bool screen_plane_use_modifiers, bool cursor_texture_is_external);
bool gsr_capture_kms_capture(gsr_capture_kms *self, AVFrame *frame, bool hdr, bool screen_plane_use_modifiers, bool cursor_texture_is_external);
void gsr_capture_kms_cleanup_kms_fds(gsr_capture_kms *self);
#endif /* GSR_CAPTURE_KMS_H */