From c6c7c343dfc66d66ac1ffe4d17c60eff4c55ef4f Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Wed, 16 Aug 2023 19:47:24 +0200 Subject: [PATCH] video_frame_info - more flags --- gfx/drivers/gl2.c | 2 +- gfx/drivers/xvideo.c | 2 +- gfx/gfx_widgets.c | 6 +++--- gfx/video_driver.c | 8 +------- gfx/video_driver.h | 5 +---- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/gfx/drivers/gl2.c b/gfx/drivers/gl2.c index e28919f3ef..cbbc2a7e7c 100644 --- a/gfx/drivers/gl2.c +++ b/gfx/drivers/gl2.c @@ -3427,7 +3427,7 @@ static bool gl2_frame(void *data, const void *frame, gl2_renderchain_data_t *chain = (gl2_renderchain_data_t*)gl->renderchain_data; unsigned width = gl->video_width; unsigned height = gl->video_height; - bool use_rgba = video_info->use_rgba; + bool use_rgba = (video_info->video_st_flags & VIDEO_FLAG_USE_RGBA) ? true : false; bool statistics_show = video_info->statistics_show; bool msg_bgcolor_enable = video_info->msg_bgcolor_enable; #ifndef EMSCRIPTEN diff --git a/gfx/drivers/xvideo.c b/gfx/drivers/xvideo.c index fd1b4d1d16..f05bb0dca8 100644 --- a/gfx/drivers/xvideo.c +++ b/gfx/drivers/xvideo.c @@ -1016,7 +1016,7 @@ static bool xv_frame(void *data, const void *frame, unsigned width, { XWindowAttributes target; xv_t *xv = (xv_t*)data; - bool rgb32 = video_info->use_rgba; + bool rgb32 = (video_info->video_st_flags & VIDEO_FLAG_USE_RGBA) ? true : false; #ifdef HAVE_MENU bool menu_is_alive = (video_info->menu_st_flags & MENU_ST_FLAG_ALIVE) ? true : false; diff --git a/gfx/gfx_widgets.c b/gfx/gfx_widgets.c index d9893ab603..0d50578e62 100644 --- a/gfx/gfx_widgets.c +++ b/gfx/gfx_widgets.c @@ -1486,9 +1486,9 @@ void gfx_widgets_frame(void *data) void *userdata = video_info->userdata; unsigned video_width = video_info->width; unsigned video_height = video_info->height; - bool widgets_is_paused = video_info->widgets_is_paused; - bool widgets_is_fastforwarding = video_info->widgets_is_fast_forwarding; - bool widgets_is_rewinding = video_info->widgets_is_rewinding; + bool widgets_is_paused = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_PAUSED) ? true : false; + bool widgets_is_fastforwarding = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_FAST_FORWARD) ? true : false; + bool widgets_is_rewinding = (video_info->video_st_flags & VIDEO_FLAG_WIDGETS_REWINDING) ? true : false; bool runloop_is_slowmotion = video_info->runloop_is_slowmotion; #ifdef HAVE_MENU bool menu_screensaver_active = (video_info->menu_st_flags & MENU_ST_FLAG_SCREENSAVER_ACTIVE) ? true : false; diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 29d2de4575..a844f22487 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2584,22 +2584,16 @@ void video_driver_build_info(video_frame_info_t *video_info) video_info->custom_vp_full_width = custom_vp->full_width; video_info->custom_vp_full_height = custom_vp->full_height; + video_info->video_st_flags = video_st->flags; #if defined(HAVE_GFX_WIDGETS) video_info->widgets_userdata = p_dispwidget; - video_info->widgets_is_paused = (video_st->flags & VIDEO_FLAG_WIDGETS_PAUSED) ? true : false; - video_info->widgets_is_fast_forwarding = (video_st->flags & VIDEO_FLAG_WIDGETS_FAST_FORWARD) ? true : false; - video_info->widgets_is_rewinding = (video_st->flags & VIDEO_FLAG_WIDGETS_REWINDING) ? true : false; #else video_info->widgets_userdata = NULL; - video_info->widgets_is_paused = false; - video_info->widgets_is_fast_forwarding = false; - video_info->widgets_is_rewinding = false; #endif video_info->width = video_st->width; video_info->height = video_st->height; - video_info->use_rgba = (video_st->flags & VIDEO_FLAG_USE_RGBA) ? true : false; video_info->hdr_enable = settings->bools.video_hdr_enable; video_info->libretro_running = false; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 2ddc1b2e43..5544499742 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -450,6 +450,7 @@ typedef struct video_frame_info bool full_screen; } osd_stat_params; + uint32_t video_st_flags; uint16_t menu_st_flags; char stat_text[1024]; @@ -457,9 +458,6 @@ typedef struct video_frame_info bool widgets_active; bool notifications_hidden; bool menu_mouse_enable; - bool widgets_is_paused; - bool widgets_is_fast_forwarding; - bool widgets_is_rewinding; bool input_menu_swap_ok_cancel_buttons; bool input_driver_nonblock_state; bool input_driver_grab_mouse_state; @@ -476,7 +474,6 @@ typedef struct video_frame_info bool windowed_fullscreen; bool fullscreen; bool font_enable; - bool use_rgba; bool hdr_support; bool libretro_running; bool xmb_shadows_enable;