diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/capture/capture.h | 2 | ||||
-rw-r--r-- | include/capture/kms_cuda.h | 1 | ||||
-rw-r--r-- | include/capture/kms_vaapi.h | 1 | ||||
-rw-r--r-- | include/capture/xcomposite.h | 9 | ||||
-rw-r--r-- | include/cursor.h | 6 | ||||
-rw-r--r-- | include/egl.h | 3 | ||||
-rw-r--r-- | include/utils.h | 4 |
7 files changed, 19 insertions, 7 deletions
diff --git a/include/capture/capture.h b/include/capture/capture.h index 2eb8e42..fbbe767 100644 --- a/include/capture/capture.h +++ b/include/capture/capture.h @@ -21,6 +21,8 @@ struct gsr_capture { /* These methods should not be called manually. Call gsr_capture_* instead */ int (*start)(gsr_capture *cap, AVCodecContext *video_codec_context, AVFrame *frame); void (*tick)(gsr_capture *cap, AVCodecContext *video_codec_context); /* can be NULL */ + bool (*is_damaged)(gsr_capture *cap); /* can be NULL */ + void (*clear_damage)(gsr_capture *cap); /* can be NULL */ bool (*should_stop)(gsr_capture *cap, bool *err); /* can be NULL */ int (*capture)(gsr_capture *cap, AVFrame *frame); void (*capture_end)(gsr_capture *cap, AVFrame *frame); /* can be NULL */ diff --git a/include/capture/kms_cuda.h b/include/capture/kms_cuda.h index fd0d396..433e053 100644 --- a/include/capture/kms_cuda.h +++ b/include/capture/kms_cuda.h @@ -9,7 +9,6 @@ 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 */ - gsr_gpu_info gpu_inf; bool hdr; gsr_color_range color_range; bool record_cursor; diff --git a/include/capture/kms_vaapi.h b/include/capture/kms_vaapi.h index 196b597..bf078b5 100644 --- a/include/capture/kms_vaapi.h +++ b/include/capture/kms_vaapi.h @@ -9,7 +9,6 @@ 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 */ - gsr_gpu_info gpu_inf; bool hdr; gsr_color_range color_range; bool record_cursor; diff --git a/include/capture/xcomposite.h b/include/capture/xcomposite.h index ce0dbad..27b289a 100644 --- a/include/capture/xcomposite.h +++ b/include/capture/xcomposite.h @@ -15,6 +15,7 @@ typedef struct { vec2i region_size; /* This is currently only used with |follow_focused| */ gsr_color_range color_range; bool record_cursor; + bool track_damage; } gsr_capture_xcomposite_params; typedef struct { @@ -37,7 +38,11 @@ typedef struct { Atom net_active_window_atom; gsr_cursor cursor; - bool clear_next_frame; + + int damage_event; + int damage_error; + XID damage; + bool damaged; } gsr_capture_xcomposite; void gsr_capture_xcomposite_init(gsr_capture_xcomposite *self, const gsr_capture_xcomposite_params *params); @@ -45,6 +50,8 @@ void gsr_capture_xcomposite_init(gsr_capture_xcomposite *self, const gsr_capture int gsr_capture_xcomposite_start(gsr_capture_xcomposite *self, AVCodecContext *video_codec_context, AVFrame *frame); void gsr_capture_xcomposite_stop(gsr_capture_xcomposite *self); void gsr_capture_xcomposite_tick(gsr_capture_xcomposite *self, AVCodecContext *video_codec_context); +bool gsr_capture_xcomposite_is_damaged(gsr_capture_xcomposite *self); +void gsr_capture_xcomposite_clear_damage(gsr_capture_xcomposite *self); bool gsr_capture_xcomposite_should_stop(gsr_capture_xcomposite *self, bool *err); int gsr_capture_xcomposite_capture(gsr_capture_xcomposite *self, AVFrame *frame); diff --git a/include/cursor.h b/include/cursor.h index b1ec6bd..2f26dfd 100644 --- a/include/cursor.h +++ b/include/cursor.h @@ -8,6 +8,7 @@ typedef struct { gsr_egl *egl; Display *display; int x_fixes_event_base; + int xi_opcode; unsigned int texture_id; vec2i size; @@ -15,12 +16,15 @@ typedef struct { vec2i position; bool cursor_image_set; + bool visible; + bool cursor_moved; } gsr_cursor; int gsr_cursor_init(gsr_cursor *self, gsr_egl *egl, Display *display); void gsr_cursor_deinit(gsr_cursor *self); -void gsr_cursor_update(gsr_cursor *self, XEvent *xev); +/* Returns true if the cursor image has updated or if the cursor has moved */ +bool gsr_cursor_update(gsr_cursor *self, XEvent *xev); void gsr_cursor_tick(gsr_cursor *self, Window relative_to); #endif /* GSR_CURSOR_H */ diff --git a/include/egl.h b/include/egl.h index afdb5a9..64dd2c6 100644 --- a/include/egl.h +++ b/include/egl.h @@ -110,6 +110,7 @@ typedef void(*__GLXextFuncPtr)(void); #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DEBUG_OUTPUT 0x92E0 +#define GL_SCISSOR_TEST 0x0C11 #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 @@ -270,11 +271,13 @@ struct gsr_egl { void (*glEnableVertexAttribArray)(unsigned int index); void (*glDrawArrays)(unsigned int mode, int first, int count); void (*glEnable)(unsigned int cap); + void (*glDisable)(unsigned int cap); void (*glBlendFunc)(unsigned int sfactor, unsigned int dfactor); int (*glGetUniformLocation)(unsigned int program, const char *name); void (*glUniform1f)(int location, float v0); void (*glUniform2f)(int location, float v0, float v1); void (*glDebugMessageCallback)(GLDEBUGPROC callback, const void *userParam); + void (*glScissor)(int x, int y, int width, int height); }; bool gsr_egl_load(gsr_egl *self, Display *dpy, bool wayland, bool is_monitor_capture); diff --git a/include/utils.h b/include/utils.h index 74fdd59..c5d659a 100644 --- a/include/utils.h +++ b/include/utils.h @@ -37,10 +37,8 @@ gsr_monitor_rotation drm_monitor_get_display_server_rotation(const gsr_egl *egl, bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info); /* |output| should be at least 128 bytes in size */ -bool gsr_get_valid_card_path(gsr_egl *egl, char *output); +bool gsr_get_valid_card_path(gsr_egl *egl, char *output, bool is_monitor_capture); /* |render_path| should be at least 128 bytes in size */ bool gsr_card_path_get_render_path(const char *card_path, char *render_path); -int even_number_ceil(int value); - #endif /* GSR_UTILS_H */ |