fb_pool: Return true from resize when dimensions change

fb-api-v3
Andri Yngvason 2021-09-04 20:00:02 +00:00
parent 1b7b51af44
commit 77d8efcbe3
2 changed files with 5 additions and 3 deletions

View File

@ -99,7 +99,7 @@ uint32_t nvnc_fb_get_fourcc_format(const struct nvnc_fb* fb);
struct nvnc_fb_pool* nvnc_fb_pool_new(uint16_t width, uint16_t height, struct nvnc_fb_pool* nvnc_fb_pool_new(uint16_t width, uint16_t height,
uint32_t fourcc_format); uint32_t fourcc_format);
void nvnc_fb_pool_resize(struct nvnc_fb_pool*, uint16_t width, uint16_t height, bool nvnc_fb_pool_resize(struct nvnc_fb_pool*, uint16_t width, uint16_t height,
uint32_t fourcc_format); uint32_t fourcc_format);
void nvnc_fb_pool_ref(struct nvnc_fb_pool*); void nvnc_fb_pool_ref(struct nvnc_fb_pool*);

View File

@ -75,18 +75,20 @@ static void nvnc_fb_pool__destroy(struct nvnc_fb_pool* self)
} }
EXPORT EXPORT
void nvnc_fb_pool_resize(struct nvnc_fb_pool* self, uint16_t width, bool nvnc_fb_pool_resize(struct nvnc_fb_pool* self, uint16_t width,
uint16_t height, uint32_t fourcc_format) uint16_t height, uint32_t fourcc_format)
{ {
if (width == self->width && height == self->height && if (width == self->width && height == self->height &&
fourcc_format == self->fourcc_format) fourcc_format == self->fourcc_format)
return; return false;
nvnc_fb_pool__destroy_fbs(self); nvnc_fb_pool__destroy_fbs(self);
self->width = width; self->width = width;
self->height = height; self->height = height;
self->fourcc_format = fourcc_format; self->fourcc_format = fourcc_format;
return true;
} }
EXPORT EXPORT