screencopy: Fix pixel format of shm buffers
parent
14768ca6e3
commit
ce86f51699
|
@ -31,6 +31,7 @@
|
||||||
#include "smooth.h"
|
#include "smooth.h"
|
||||||
#include "time-util.h"
|
#include "time-util.h"
|
||||||
#include "usdt.h"
|
#include "usdt.h"
|
||||||
|
#include "pixels.h"
|
||||||
|
|
||||||
#define DELAY_SMOOTHER_TIME_CONSTANT 0.5 // s
|
#define DELAY_SMOOTHER_TIME_CONSTANT 0.5 // s
|
||||||
|
|
||||||
|
@ -63,23 +64,24 @@ static void screencopy_buffer_done(void* data,
|
||||||
{
|
{
|
||||||
struct screencopy* self = data;
|
struct screencopy* self = data;
|
||||||
uint32_t width, height, stride, fourcc;
|
uint32_t width, height, stride, fourcc;
|
||||||
|
enum wv_buffer_type type = WV_BUFFER_UNSPEC;
|
||||||
|
|
||||||
if (self->have_linux_dmabuf) {
|
if (self->have_linux_dmabuf) {
|
||||||
width = self->dmabuf_width;
|
width = self->dmabuf_width;
|
||||||
height = self->dmabuf_height;
|
height = self->dmabuf_height;
|
||||||
stride = 0;
|
stride = 0;
|
||||||
fourcc = self->fourcc;
|
fourcc = self->fourcc;
|
||||||
wv_buffer_pool_resize(self->pool, WV_BUFFER_DMABUF, width,
|
type = WV_BUFFER_DMABUF;
|
||||||
height, stride, fourcc);
|
|
||||||
} else {
|
} else {
|
||||||
width = self->wl_shm_width;
|
width = self->wl_shm_width;
|
||||||
height = self->wl_shm_height;
|
height = self->wl_shm_height;
|
||||||
stride = self->wl_shm_stride;
|
stride = self->wl_shm_stride;
|
||||||
fourcc = self->fourcc;
|
fourcc = fourcc_from_wl_shm(self->wl_shm_format);
|
||||||
wv_buffer_pool_resize(self->pool, WV_BUFFER_SHM, width,
|
type = WV_BUFFER_SHM;
|
||||||
height, stride, self->wl_shm_format);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wv_buffer_pool_resize(self->pool, type, width, height, stride, fourcc);
|
||||||
|
|
||||||
struct wv_buffer* buffer = wv_buffer_pool_acquire(self->pool);
|
struct wv_buffer* buffer = wv_buffer_pool_acquire(self->pool);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
screencopy_stop(self);
|
screencopy_stop(self);
|
||||||
|
|
Loading…
Reference in New Issue