mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 10:40:25 +00:00
get_splashscreeen: add assertions
This commit is contained in:
@@ -630,9 +630,14 @@ struct video_frame *get_splashscreen()
|
||||
{
|
||||
struct video_desc desc;
|
||||
|
||||
desc.width = 512;
|
||||
desc.height = 512;
|
||||
desc.color_spec = RGBA;
|
||||
enum {
|
||||
FBUF_W = 512,
|
||||
FBUF_H = 512,
|
||||
FBUF_CS = RGBA,
|
||||
};
|
||||
desc.width = FBUF_W;
|
||||
desc.height = FBUF_H;
|
||||
desc.color_spec = (codec_t) FBUF_CS;
|
||||
desc.interlacing = PROGRESSIVE;
|
||||
desc.fps = 1;
|
||||
desc.tile_count = 1;
|
||||
@@ -641,6 +646,10 @@ struct video_frame *get_splashscreen()
|
||||
|
||||
const char *data = splash_data;
|
||||
memset(frame->tiles[0].data, 0, frame->tiles[0].data_len);
|
||||
// center the pixture; framebuffer size must be greater or equal
|
||||
// the splash size
|
||||
_Static_assert(splash_width >= FBUF_W && splash_height >= FBUF_H,
|
||||
"framebuffer smaller than splash size");
|
||||
for (unsigned int y = 0; y < splash_height; ++y) {
|
||||
char *line = frame->tiles[0].data;
|
||||
line += vc_get_linesize(frame->tiles[0].width,
|
||||
@@ -649,6 +658,7 @@ struct video_frame *get_splashscreen()
|
||||
line += vc_get_linesize(
|
||||
(frame->tiles[0].width - splash_width)/2,
|
||||
frame->color_spec);
|
||||
_Static_assert((codec_t) FBUF_CS == RGBA, "RGBA is expected");
|
||||
for (unsigned int x = 0; x < splash_width; ++x) {
|
||||
HEADER_PIXEL(data,line);
|
||||
line += 4;
|
||||
|
||||
Reference in New Issue
Block a user