aboutsummaryrefslogtreecommitdiff
path: root/src/capture/xcomposite.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-03-09 18:54:53 +0100
committerdec05eba <dec05eba@protonmail.com>2024-03-09 18:54:53 +0100
commit45ad3695b657b33c332bbfd3b08d6a15a5072587 (patch)
tree06485df0ba8350c65da4a99f208b597cedacd8e6 /src/capture/xcomposite.c
parenta3fedae32937f8965c9905e12633fa4de0c3658e (diff)
Refactor capture base
Diffstat (limited to 'src/capture/xcomposite.c')
-rw-r--r--src/capture/xcomposite.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c
index 73da951..eeed2ab 100644
--- a/src/capture/xcomposite.c
+++ b/src/capture/xcomposite.c
@@ -42,6 +42,7 @@ static Window get_focused_window(Display *display, Atom net_active_window_atom)
int gsr_capture_xcomposite_start(gsr_capture_xcomposite *self, AVCodecContext *video_codec_context, AVFrame *frame) {
self->base.video_codec_context = video_codec_context;
+ self->base.egl = self->params.egl;
if(self->params.follow_focused) {
self->net_active_window_atom = XInternAtom(self->params.egl->x11.dpy, "_NET_ACTIVE_WINDOW", False);
@@ -89,7 +90,7 @@ int gsr_capture_xcomposite_start(gsr_capture_xcomposite *self, AVCodecContext *v
}
if(gsr_cursor_init(&self->cursor, self->params.egl, self->params.egl->x11.dpy) != 0) {
- gsr_capture_xcomposite_stop(self, video_codec_context);
+ gsr_capture_xcomposite_stop(self);
return -1;
}
@@ -119,10 +120,10 @@ int gsr_capture_xcomposite_start(gsr_capture_xcomposite *self, AVCodecContext *v
return 0;
}
-void gsr_capture_xcomposite_stop(gsr_capture_xcomposite *self, AVCodecContext *video_codec_context) {
- (void)video_codec_context;
+void gsr_capture_xcomposite_stop(gsr_capture_xcomposite *self) {
window_texture_deinit(&self->window_texture);
gsr_cursor_deinit(&self->cursor);
+ gsr_capture_base_stop(&self->base);
}
void gsr_capture_xcomposite_tick(gsr_capture_xcomposite *self, AVCodecContext *video_codec_context) {