Add a function to return the frame buffer size.

* This returns the frame buffer size without the fb header size.
This commit is contained in:
iabdalkader 2020-07-20 21:39:27 +02:00
parent e18f83cfe1
commit 1d93c54983
2 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#define CONSERVATIVE_JPEG_BUF_SIZE (OMV_JPEG_BUF_SIZE-64) #define CONSERVATIVE_JPEG_BUF_SIZE (OMV_JPEG_BUF_SIZE-64)
extern char _fb_base; extern char _fb_base;
extern char _fballoc;
framebuffer_t *framebuffer = (framebuffer_t *) &_fb_base; framebuffer_t *framebuffer = (framebuffer_t *) &_fb_base;
extern char _jpeg_buf; extern char _jpeg_buf;
@ -222,6 +223,11 @@ uint32_t framebuffer_get_frame_size()
} }
} }
uint32_t framebuffer_get_buffer_size()
{
return &_fballoc - (char *) framebuffer->pixels;
}
uint8_t *framebuffer_get_buffer() uint8_t *framebuffer_get_buffer()
{ {
return framebuffer->pixels; return framebuffer->pixels;

View File

@ -64,6 +64,9 @@ int32_t framebuffer_get_depth();
// otherwise return 0 if the framebuffer is unintialized or invalid (e.g. first frame). // otherwise return 0 if the framebuffer is unintialized or invalid (e.g. first frame).
uint32_t framebuffer_get_frame_size(); uint32_t framebuffer_get_frame_size();
// Return the max frame size that fits the framebuffer (i.e OMV_RAW_BUF_SIZE - sizeof(framebuffer_t))
uint32_t framebuffer_get_buffer_size();
// Return the current buffer address. // Return the current buffer address.
uint8_t *framebuffer_get_buffer(); uint8_t *framebuffer_get_buffer();