|
|
|
@ -5,8 +5,9 @@
|
|
|
|
|
#include <wlr/render/dmabuf.h>
|
|
|
|
|
#include <wlr/types/wlr_export_dmabuf_v1.h>
|
|
|
|
|
#include <wlr/types/wlr_output.h>
|
|
|
|
|
#include "wlr-export-dmabuf-unstable-v1-protocol.h"
|
|
|
|
|
#include <wlr/util/log.h>
|
|
|
|
|
#include "util/signal.h"
|
|
|
|
|
#include "wlr-export-dmabuf-unstable-v1-protocol.h"
|
|
|
|
|
|
|
|
|
|
#define EXPORT_DMABUF_MANAGER_VERSION 1
|
|
|
|
|
|
|
|
|
@ -146,8 +147,14 @@ static void manager_handle_capture_output(struct wl_client *client,
|
|
|
|
|
frame->output_swap_buffers.notify = frame_output_handle_swap_buffers;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void manager_handle_destroy(struct wl_client *client,
|
|
|
|
|
struct wl_resource *manager_resource) {
|
|
|
|
|
wl_resource_destroy(manager_resource);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const struct zwlr_export_dmabuf_manager_v1_interface manager_impl = {
|
|
|
|
|
.capture_output = manager_handle_capture_output,
|
|
|
|
|
.destroy = manager_handle_destroy,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void manager_handle_resource_destroy(struct wl_resource *resource) {
|
|
|
|
@ -185,6 +192,7 @@ struct wlr_export_dmabuf_manager_v1 *wlr_export_dmabuf_manager_v1_create(
|
|
|
|
|
}
|
|
|
|
|
wl_list_init(&manager->resources);
|
|
|
|
|
wl_list_init(&manager->frames);
|
|
|
|
|
wl_signal_init(&manager->events.destroy);
|
|
|
|
|
|
|
|
|
|
manager->global = wl_global_create(display,
|
|
|
|
|
&zwlr_export_dmabuf_manager_v1_interface, EXPORT_DMABUF_MANAGER_VERSION,
|
|
|
|
@ -205,6 +213,7 @@ void wlr_export_dmabuf_manager_v1_destroy(
|
|
|
|
|
if (manager == NULL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
wlr_signal_emit_safe(&manager->events.destroy, manager);
|
|
|
|
|
wl_list_remove(&manager->display_destroy.link);
|
|
|
|
|
wl_global_destroy(manager->global);
|
|
|
|
|
struct wl_resource *resource, *resource_tmp;
|
|
|
|
|