2019-10-08 18:41:23 +00:00
|
|
|
/*
|
2020-01-04 15:05:15 +00:00
|
|
|
* Copyright (c) 2019 - 2020 Andri Yngvason
|
2019-10-08 18:41:23 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
|
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
|
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
|
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
|
|
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2019-10-06 17:07:33 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
2020-03-16 22:01:43 +00:00
|
|
|
#include <aml.h>
|
2019-10-10 22:51:44 +00:00
|
|
|
#include "frame-capture.h"
|
2019-10-06 17:07:33 +00:00
|
|
|
|
|
|
|
struct zwlr_export_dmabuf_manager_v1;
|
|
|
|
struct zwlr_export_dmabuf_frame_v1;
|
|
|
|
struct wl_output;
|
2020-03-16 22:01:43 +00:00
|
|
|
struct aml_timer;
|
2019-10-06 17:07:33 +00:00
|
|
|
|
|
|
|
struct dmabuf_plane {
|
|
|
|
int fd;
|
|
|
|
uint32_t offset;
|
|
|
|
uint32_t size;
|
|
|
|
uint32_t pitch;
|
|
|
|
uint64_t modifier;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dmabuf_frame {
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t format;
|
|
|
|
|
|
|
|
uint32_t n_planes;
|
|
|
|
struct dmabuf_plane plane[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dmabuf_capture {
|
2019-10-10 22:51:44 +00:00
|
|
|
struct frame_capture fc;
|
|
|
|
|
2019-10-09 19:12:16 +00:00
|
|
|
struct zwlr_export_dmabuf_manager_v1* manager;
|
2019-10-06 17:07:33 +00:00
|
|
|
struct zwlr_export_dmabuf_frame_v1* zwlr_frame;
|
|
|
|
struct dmabuf_frame frame;
|
2020-04-26 13:55:20 +00:00
|
|
|
uint64_t render_finish_time;
|
2019-10-06 17:07:33 +00:00
|
|
|
};
|
|
|
|
|
2019-10-10 22:51:44 +00:00
|
|
|
void dmabuf_capture_init(struct dmabuf_capture* self);
|