diff --git a/camera/camera_driver.c b/camera/camera_driver.c index 249e563908..a4031fe060 100644 --- a/camera/camera_driver.c +++ b/camera/camera_driver.c @@ -29,6 +29,8 @@ #include "../list_special.h" #include "../verbosity.h" +#include "../gfx/video_driver.h" + static const camera_driver_t *camera_drivers[] = { #ifdef HAVE_V4L2 &camera_v4l2, @@ -191,7 +193,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data) if (settings->camera.allow) return camera_driver->start(camera_data); - runloop_msg_queue_push( + video_driver_msg_queue_push( "Camera is explicitly disabled.\n", 1, 180, false); } break; diff --git a/cheevos.c b/cheevos.c index 11bc2fd9ab..645cc280e4 100644 --- a/cheevos.c +++ b/cheevos.c @@ -34,6 +34,7 @@ #include "cheevos.h" #include "command.h" #include "dynamic.h" +#include "gfx/video_driver.h" #include "network/net_http_special.h" #include "tasks/tasks_internal.h" #include "configuration.h" @@ -1831,8 +1832,8 @@ static int cheevos_login(retro_time_t *timeout) if (!username || !*username || !password || !*password) { - runloop_msg_queue_push("Missing Retro Achievements account information.", 0, 5 * 60, false); - runloop_msg_queue_push("Please fill in your account information in Settings.", 0, 5 * 60, false); + video_driver_msg_queue_push("Missing Retro Achievements account information.", 0, 5 * 60, false); + video_driver_msg_queue_push("Please fill in your account information in Settings.", 0, 5 * 60, false); RARCH_ERR("CHEEVOS username and/or password not informed.\n"); return -1; } @@ -1863,7 +1864,7 @@ static int cheevos_login(retro_time_t *timeout) return 0; } - runloop_msg_queue_push("Retro Achievements login error.", + video_driver_msg_queue_push("Retro Achievements login error.", 0, 5 * 60, false); RARCH_ERR("CHEEVOS error getting user token.\n"); return -1; @@ -1938,8 +1939,8 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set) RARCH_LOG("CHEEVOS awarding cheevo %u: %s (%s).\n", cheevo->id, cheevo->title, cheevo->description); - runloop_msg_queue_push(cheevo->title, 0, 3 * 60, false); - runloop_msg_queue_push(cheevo->description, 0, 5 * 60, false); + video_driver_msg_queue_push(cheevo->title, 0, 3 * 60, false); + video_driver_msg_queue_push(cheevo->description, 0, 5 * 60, false); cheevos_make_unlock_url(cheevo, url, sizeof(url)); task_push_http_transfer(url, true, NULL, cheevos_unlocked, cheevo); @@ -2687,7 +2688,7 @@ found: free((void*)json); } - runloop_msg_queue_push("Error loading achievements.", 0, 5 * 60, false); + video_driver_msg_queue_push("Error loading achievements.", 0, 5 * 60, false); RARCH_ERR("CHEEVOS error loading achievements.\n"); return false; } @@ -2860,7 +2861,7 @@ bool cheevos_toggle_hardcore_mode(void) command_event(CMD_EVENT_REWIND_DEINIT, NULL); RARCH_LOG("%s\n", msg_hash_to_str(MSG_CHEEVOS_HARDCORE_MODE_ENABLE)); - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_CHEEVOS_HARDCORE_MODE_ENABLE), 0, 3 * 60, true); } else diff --git a/command.c b/command.c index abff46c982..e33a977ee2 100644 --- a/command.c +++ b/command.c @@ -65,6 +65,7 @@ #include "audio/audio_driver.h" #include "record/record_driver.h" #include "file_path_special.h" +#include "gfx/video_driver.h" #include "autosave.h" #include "core_info.h" #include "core_type.h" @@ -185,7 +186,7 @@ static bool command_set_shader(const char *arg) } snprintf(msg, sizeof(msg), "Shader: \"%s\"", arg); - runloop_msg_queue_push(msg, 1, 120, true); + video_driver_msg_queue_push(msg, 1, 120, true); RARCH_LOG("%s \"%s\".\n", msg_hash_to_str(MSG_APPLYING_SHADER), arg); @@ -889,7 +890,7 @@ static void command_event_disk_control_set_eject(bool new_state, bool print_log) /* Only noise in menu. */ if (print_log) - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); } } @@ -949,7 +950,7 @@ static void command_event_disk_control_set_index(unsigned idx) RARCH_ERR("%s\n", msg); else RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); } } @@ -992,7 +993,7 @@ static bool command_event_disk_control_append_image(const char *path) snprintf(msg, sizeof(msg), "%s: ", msg_hash_to_str(MSG_APPENDED_DISK)); strlcat(msg, path, sizeof(msg)); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 0, 180, true); + video_driver_msg_queue_push(msg, 0, 180, true); command_event(CMD_EVENT_AUTOSAVE_DEINIT, NULL); @@ -1099,7 +1100,7 @@ static void command_event_set_volume(float gain) snprintf(msg, sizeof(msg), "%s: %.1f dB", msg_hash_to_str(MSG_AUDIO_VOLUME), settings->audio.volume); - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); RARCH_LOG("%s\n", msg); audio_driver_set_volume_gain(db_to_gain(settings->audio.volume)); @@ -1511,7 +1512,7 @@ static bool command_event_save_core_config(void) sizeof(config_dir)); else { - runloop_msg_queue_push(msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET), 1, 180, true); + video_driver_msg_queue_push(msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET), 1, 180, true); RARCH_ERR("%s\n", msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET)); return false; } @@ -1576,7 +1577,7 @@ static bool command_event_save_core_config(void) command_event_save_config(config_path, msg, sizeof(msg)); - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); if (overrides_active) runloop_ctl(RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, NULL); @@ -1616,7 +1617,7 @@ static void command_event_save_current_config(int override_type) command_event_save_config(path_get(RARCH_PATH_CONFIG), msg, sizeof(msg)); if (!string_is_empty(msg)) - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); } static void command_event_undo_save_state(char *s, size_t len) @@ -1709,7 +1710,7 @@ static void command_event_main_state(unsigned cmd) MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES), sizeof(msg)); if (push_msg) - runloop_msg_queue_push(msg, 2, 180, true); + video_driver_msg_queue_push(msg, 2, 180, true); RARCH_LOG("%s\n", msg); } @@ -1778,7 +1779,7 @@ bool command_event(enum event_command cmd, void *data) snprintf(msg, sizeof(msg),"%s: %dx%d", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION), width, height); - runloop_msg_queue_push(msg, 1, 100, true); + video_driver_msg_queue_push(msg, 1, 100, true); } } #endif @@ -1873,7 +1874,7 @@ bool command_event(enum event_command cmd, void *data) break; case CMD_EVENT_RESET: RARCH_LOG("%s.\n", msg_hash_to_str(MSG_RESET)); - runloop_msg_queue_push(msg_hash_to_str(MSG_RESET), 1, 120, true); + video_driver_msg_queue_push(msg_hash_to_str(MSG_RESET), 1, 120, true); #ifdef HAVE_CHEEVOS cheevos_set_cheats(); @@ -2031,7 +2032,7 @@ bool command_event(enum event_command cmd, void *data) return false; } - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); RARCH_LOG("%s\n", msg); } break; @@ -2226,7 +2227,7 @@ bool command_event(enum event_command cmd, void *data) break; case CMD_EVENT_SHUTDOWN: #if defined(__linux__) && !defined(ANDROID) - runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true); + video_driver_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true); command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); command_event(CMD_EVENT_QUIT, NULL); system("shutdown -P now"); @@ -2234,7 +2235,7 @@ bool command_event(enum event_command cmd, void *data) break; case CMD_EVENT_REBOOT: #if defined(__linux__) && !defined(ANDROID) - runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true); + video_driver_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true); command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); command_event(CMD_EVENT_QUIT, NULL); system("shutdown -r now"); @@ -2279,7 +2280,7 @@ bool command_event(enum event_command cmd, void *data) command_event(CMD_EVENT_AUDIO_STOP, NULL); is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); - runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1, is_paused ? 1: 30, true); + video_driver_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1, is_paused ? 1: 30, true); if (settings->video.black_frame_insertion || is_paused) { @@ -2427,7 +2428,7 @@ bool command_event(enum event_command cmd, void *data) } } else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS), 1, 120, true); break; @@ -2447,7 +2448,7 @@ bool command_event(enum event_command cmd, void *data) command_event_check_disk_next(control); } else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS), 1, 120, true); break; @@ -2467,7 +2468,7 @@ bool command_event(enum event_command cmd, void *data) command_event_check_disk_prev(control); } else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS), 1, 120, true); break; @@ -2528,7 +2529,7 @@ bool command_event(enum event_command cmd, void *data) input_driver_set_hotkey_block(); input_driver_keyboard_mapping_set_block(1); if (mode != -1) - runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_ON), + video_driver_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_ON), 1, 120, true); } else @@ -2538,7 +2539,7 @@ bool command_event(enum event_command cmd, void *data) input_driver_unset_hotkey_block(); input_driver_keyboard_mapping_set_block(0); if (mode != -1) - runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_OFF), + video_driver_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_OFF), 1, 120, true); } diff --git a/configuration.c b/configuration.c index 5480f550de..1e58acc444 100644 --- a/configuration.c +++ b/configuration.c @@ -32,6 +32,7 @@ #include "file_path_special.h" #include "audio/audio_driver.h" +#include "gfx/video_driver.h" #include "configuration.h" #include "content.h" #include "config.def.h" @@ -2320,7 +2321,7 @@ bool config_load_override(void) /* Restore the libretro_path we're using * since it will be overwritten by the override when reloading. */ path_set(RARCH_PATH_CORE, buf); - runloop_msg_queue_push("Configuration override loaded.", 1, 100, true); + video_driver_msg_queue_push("Configuration override loaded.", 1, 100, true); /* Reset save paths. */ retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL); @@ -2427,7 +2428,7 @@ bool config_load_remap(void) RARCH_LOG("Remaps: game-specific remap found at %s.\n", game_path); if (input_remapping_load_file(new_conf, game_path)) { - runloop_msg_queue_push("Game remap file loaded.", 1, 100, true); + video_driver_msg_queue_push("Game remap file loaded.", 1, 100, true); return true; } } @@ -2446,7 +2447,7 @@ bool config_load_remap(void) RARCH_LOG("Remaps: core-specific remap found at %s.\n", core_path); if (input_remapping_load_file(new_conf, core_path)) { - runloop_msg_queue_push("Core remap file loaded.", 1, 100, true); + video_driver_msg_queue_push("Core remap file loaded.", 1, 100, true); return true; } } diff --git a/dirs.c b/dirs.c index ad53fbd3eb..1466ec507e 100644 --- a/dirs.c +++ b/dirs.c @@ -34,6 +34,8 @@ #include "runloop.h" #include "verbosity.h" +#include "gfx/video_driver.h" + struct rarch_dir_list { struct string_list *list; @@ -156,7 +158,7 @@ void dir_check_shader(bool pressed_next, bool pressed_prev) snprintf(msg, sizeof(msg), "%s #%u: \"%s\".", msg_hash_to_str(MSG_SHADER), (unsigned)dir_list->ptr, shader); - runloop_msg_queue_push(msg, 2, 120, true); + video_driver_msg_queue_push(msg, 2, 120, true); RARCH_LOG("%s \"%s\".\n", msg_hash_to_str(MSG_APPLYING_SHADER), diff --git a/driver.c b/driver.c index 5de24cb3de..73b1a4e41e 100644 --- a/driver.c +++ b/driver.c @@ -276,7 +276,7 @@ static bool driver_update_system_av_info(const struct retro_system_av_info *info * Take the easiest route out and just restart the recording. */ if (recording_driver_get_data_ptr()) { - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT), 2, 180, false); command_event(CMD_EVENT_RECORD_DEINIT, NULL); diff --git a/dynamic.c b/dynamic.c index fccd1fab31..342c38a1c0 100644 --- a/dynamic.c +++ b/dynamic.c @@ -50,6 +50,7 @@ #include "core.h" #include "driver.h" #include "performance_counters.h" +#include "gfx/video_driver.h" #include "gfx/video_context_driver.h" #include "cores/internal_cores.h" @@ -251,7 +252,7 @@ static bool load_dynamic_core(void) path_get(RARCH_PATH_CORE)); RARCH_ERR("Error(s): %s\n", dylib_error()); - runloop_msg_queue_push(msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE), 1, 180, true); + video_driver_msg_queue_push(msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE), 1, 180, true); return false; } @@ -1010,7 +1011,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) { const struct retro_message *msg = (const struct retro_message*)data; RARCH_LOG("Environ SET_MESSAGE: %s\n", msg->msg); - runloop_msg_queue_push(msg->msg, 3, msg->frames, true); + video_driver_msg_queue_push(msg->msg, 3, msg->frames, true); break; } diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index fd3ccdf0fc..e4d7a59442 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -32,6 +32,7 @@ #include "../../input/common/input_x11_common.h" #include "../../configuration.h" #include "../../verbosity.h" +#include "../../gfx/video_driver.h" #include "../../runloop.h" #ifdef HAVE_DBUS @@ -730,7 +731,7 @@ void x11_update_window_title(void *data) if (video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps))) XStoreName(g_x11_dpy, g_x11_win, buf); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } bool x11_input_ctx_new(bool true_full) diff --git a/gfx/drivers/exynos_gfx.c b/gfx/drivers/exynos_gfx.c index 76c031914b..304c4e2f5a 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -35,11 +35,11 @@ #include "../../config.h" #endif +#include "../video_driver.h" #include "../common/drm_common.h" #include "../font_driver.h" #include "../../retroarch.h" #include "../../runloop.h" -#include "../../runloop.h" /* TODO: Honor these properties: vsync, menu rotation, menu alpha, aspect ratio change */ @@ -1313,7 +1313,7 @@ static bool exynos_gfx_frame(void *data, const void *frame, unsigned width, video_monitor_get_fps(buffer, sizeof(buffer), settings->fps_show ? buffer_fps : NULL, sizeof(buffer_fps)); - runloop_msg_queue_push(buffer_fps, 1, 1, false); + video_driver_msg_queue_push(buffer_fps, 1, 1, false); } /* If at this point the dimension parameters are still zero, setup some * diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index f3be92b8b9..a23caf4f34 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -30,6 +30,7 @@ #include "../../defines/psp_defines.h" #include "../common/vita2d_common.h" #include "../../driver.h" +#include "../video_driver.h" #include "../../runloop.h" #include "../video_coord_array.h" @@ -212,7 +213,7 @@ static bool vita2d_gfx_frame(void *data, const void *frame, video_monitor_get_fps(buffer, sizeof(buffer), settings->fps_show ? buffer_fps : NULL, sizeof(buffer_fps)); - runloop_msg_queue_push(buffer_fps, 1, 1, false); + video_driver_msg_queue_push(buffer_fps, 1, 1, false); } #ifdef HAVE_OVERLAY diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index 033e83f498..013e1246ed 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -324,7 +324,7 @@ static void android_gfx_ctx_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static bool android_gfx_ctx_set_video_mode(void *data, diff --git a/gfx/drivers_context/bbqnx_ctx.c b/gfx/drivers_context/bbqnx_ctx.c index b744483343..79c69f6642 100644 --- a/gfx/drivers_context/bbqnx_ctx.c +++ b/gfx/drivers_context/bbqnx_ctx.c @@ -42,6 +42,7 @@ #include "../common/gl_common.h" #endif +#include "../video_driver.h" #include "../../configuration.h" #include "../../runloop.h" @@ -303,7 +304,7 @@ static void gfx_ctx_qnx_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static bool gfx_ctx_qnx_set_video_mode(void *data, diff --git a/gfx/drivers_context/cgl_ctx.c b/gfx/drivers_context/cgl_ctx.c index 561ae87070..0d7713ba11 100644 --- a/gfx/drivers_context/cgl_ctx.c +++ b/gfx/drivers_context/cgl_ctx.c @@ -32,6 +32,7 @@ #include "../../configuration.h" #include "../../runloop.h" #include "../../configuration.h" +#include "../video_driver.h" #include "../video_context_driver.h" typedef int CGSConnectionID; @@ -124,7 +125,7 @@ static void gfx_ctx_cgl_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index d211fdff86..156b6f7675 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -39,6 +39,7 @@ #include #import "../../ui/drivers/cocoa/cocoa_common.h" +#include "../video_driver.h" #include "../video_context_driver.h" #include "../../configuration.h" #include "../../runloop.h" @@ -436,7 +437,7 @@ static void cocoagl_gfx_ctx_update_window_title(void *data) window->set_title(&view, buf); #endif if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static bool cocoagl_gfx_ctx_get_metrics(void *data, enum display_metric_types type, diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index bbd2ca6bdb..9edc4bd2a2 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -26,6 +26,7 @@ #include +#include "../video_driver.h" #include "../drivers/d3d.h" #include "../common/win32_common.h" @@ -115,7 +116,7 @@ static void gfx_ctx_d3d_update_title(void *data) stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f)); strlcat(buffer_fps, mem, sizeof(buffer_fps)); #endif - runloop_msg_queue_push(buffer_fps, 1, 1, false); + video_driver_msg_queue_push(buffer_fps, 1, 1, false); } } diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c index 026bc1c250..d1c0e0d013 100644 --- a/gfx/drivers_context/drm_ctx.c +++ b/gfx/drivers_context/drm_ctx.c @@ -35,6 +35,7 @@ #include #include +#include "../video_driver.h" #include "../../verbosity.h" #include "../../configuration.h" #include "../../runloop.h" @@ -283,7 +284,7 @@ static void gfx_ctx_drm_update_window_title(void *data) buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push( buf_fps, 1, 1, false); + video_driver_msg_queue_push( buf_fps, 1, 1, false); } static void gfx_ctx_drm_get_video_size(void *data, diff --git a/gfx/drivers_context/emscriptenegl_ctx.c b/gfx/drivers_context/emscriptenegl_ctx.c index 0deaf18f4d..d5a83415cf 100644 --- a/gfx/drivers_context/emscriptenegl_ctx.c +++ b/gfx/drivers_context/emscriptenegl_ctx.c @@ -26,6 +26,7 @@ #include "../../configuration.h" #include "../../runloop.h" +#include "../video_driver.h" #include "../video_context_driver.h" #ifdef HAVE_EGL @@ -97,16 +98,18 @@ static bool gfx_ctx_emscripten_set_resize(void *data, static void gfx_ctx_emscripten_update_window_title(void *data) { - char buf[128] = {0}; - char buf_fps[128] = {0}; + char buf[128]; + char buf_fps[128]; settings_t *settings = config_get_ptr(); + buf[0] = buf_fps[0] = '\0'; + (void)data; video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static void gfx_ctx_emscripten_get_video_size(void *data, diff --git a/gfx/drivers_context/khr_display_ctx.c b/gfx/drivers_context/khr_display_ctx.c index f1fb5a6186..912d025703 100644 --- a/gfx/drivers_context/khr_display_ctx.c +++ b/gfx/drivers_context/khr_display_ctx.c @@ -17,6 +17,7 @@ #include "../../config.h" #endif +#include "../video_driver.h" #include "../../configuration.h" #include "../../runloop.h" #include "../../frontend/frontend_driver.h" @@ -124,7 +125,7 @@ static void gfx_ctx_khr_display_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static bool gfx_ctx_khr_display_set_video_mode(void *data, diff --git a/gfx/drivers_context/mali_fbdev_ctx.c b/gfx/drivers_context/mali_fbdev_ctx.c index 8670f1147c..25edeb6066 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -36,6 +36,7 @@ #include "../common/gl_common.h" #endif +#include "../video_driver.h" #include "../../frontend/frontend_driver.h" #include "../../configuration.h" #include "../../runloop.h" @@ -170,7 +171,7 @@ static void gfx_ctx_mali_fbdev_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static bool gfx_ctx_mali_fbdev_set_video_mode(void *data, diff --git a/gfx/drivers_context/opendingux_fbdev_ctx.c b/gfx/drivers_context/opendingux_fbdev_ctx.c index 1a7c742ddf..8bb444c0ad 100644 --- a/gfx/drivers_context/opendingux_fbdev_ctx.c +++ b/gfx/drivers_context/opendingux_fbdev_ctx.c @@ -28,6 +28,7 @@ #include "../common/gl_common.h" #endif +#include "../video_driver.h" #include "../../frontend/frontend_driver.h" #include "../../configuration.h" #include "../../runloop.h" @@ -153,7 +154,7 @@ static void gfx_ctx_opendingux_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static bool gfx_ctx_opendingux_set_video_mode(void *data, diff --git a/gfx/drivers_context/osmesa_ctx.c b/gfx/drivers_context/osmesa_ctx.c index c660fcde04..92366c333a 100644 --- a/gfx/drivers_context/osmesa_ctx.c +++ b/gfx/drivers_context/osmesa_ctx.c @@ -29,6 +29,7 @@ #include +#include "../video_driver.h" #include "../../runloop.h" #include "../common/gl_common.h" @@ -311,8 +312,8 @@ static void osmesa_ctx_update_window_title(void *data) { static char buf[128] = {0}; static char buf_fps[128] = {0}; - settings_t *settings = config_get_ptr(); - gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data; + settings_t *settings = config_get_ptr(); + gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data; if (!osmesa) return; @@ -320,7 +321,7 @@ static void osmesa_ctx_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static void osmesa_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width, diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index e3494a23f5..6f94ebf28c 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -29,6 +29,7 @@ #include "../../runloop.h" #include "../../defines/ps3_defines.h" #include "../common/gl_common.h" +#include "../video_driver.h" #include "../video_context_driver.h" #ifdef HAVE_CONFIG_H @@ -211,7 +212,7 @@ static void gfx_ctx_ps3_update_window_title(void *data) video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static void gfx_ctx_ps3_get_video_size(void *data, diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index 6bbf680b1e..d4db4121d4 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -289,7 +289,7 @@ static void sdl_ctx_update_window_title(void *data) #endif } if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width, diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index 0e48383b02..ddd5c5a541 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -30,6 +30,7 @@ #include +#include "../video_driver.h" #include "../../configuration.h" #include "../../runloop.h" #include "../video_context_driver.h" @@ -107,16 +108,18 @@ static bool gfx_ctx_vc_set_resize(void *data, unsigned width, unsigned height) static void gfx_ctx_vc_update_window_title(void *data) { - char buf[128] = {0}; - char buf_fps[128] = {0}; + char buf[128]; + char buf_fps[128]; settings_t *settings = config_get_ptr(); + buf[0] = buf_fps[0] = '\0'; + (void)data; video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static void gfx_ctx_vc_get_video_size(void *data, diff --git a/gfx/drivers_context/vivante_fbdev_ctx.c b/gfx/drivers_context/vivante_fbdev_ctx.c index cac00f389b..f93404c96c 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -148,16 +148,18 @@ static bool gfx_ctx_vivante_set_resize(void *data, static void gfx_ctx_vivante_update_window_title(void *data) { - char buf[128] = {0}; - char buf_fps[128] = {0}; + char buf[128]; + char buf_fps[128]; settings_t *settings = config_get_ptr(); + buf[0] = buf_fps[0] = '\0'; + (void)data; video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static bool gfx_ctx_vivante_set_video_mode(void *data, diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index d5e231e23a..9354a36278 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -22,6 +22,8 @@ #include +#include + #ifdef HAVE_CONFIG_H #include "../../config.h" #endif @@ -42,13 +44,13 @@ #include "../common/gl_common.h" #endif +#include "../video_driver.h" #include "../../configuration.h" #include "../../frontend/frontend_driver.h" #include "../../runloop.h" #include "../../input/input_keyboard.h" #include "../../input/input_keymaps.h" #include "../../input/input_joypad_driver.h" -#include typedef struct gfx_ctx_wayland_data { @@ -734,7 +736,7 @@ static void gfx_ctx_wl_update_window_title(void *data) wl_shell_surface_set_title(wl->shell_surf, buf); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index 90ac60eceb..6af575d224 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -42,6 +42,7 @@ #include "../../configuration.h" #include "../../dynamic.h" #include "../../runloop.h" +#include "../video_driver.h" #include "../video_context_driver.h" #include "../common/win32_common.h" @@ -399,7 +400,7 @@ static void gfx_ctx_wgl_update_window_title(void *data) buf_fps, sizeof(buf_fps))) window->set_title(&main_window, buf); if (settings->fps_show) - runloop_msg_queue_push(buf_fps, 1, 1, false); + video_driver_msg_queue_push(buf_fps, 1, 1, false); } static void gfx_ctx_wgl_get_video_size(void *data, diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 3415416f23..d644f10ce4 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #ifdef HAVE_CONFIG_H @@ -41,6 +42,7 @@ #include "../menu/menu_setting.h" #endif +#include "video_driver.h" #include "video_thread_wrapper.h" #include "video_context_driver.h" @@ -56,6 +58,7 @@ #include "../core.h" #include "../command.h" #include "../msg_hash.h" +#include "ui/ui_companion_driver.h" #include "../verbosity.h" #define MEASURE_FRAME_TIME_SAMPLES_COUNT (2 * 1024) @@ -64,6 +67,14 @@ #define FPS_UPDATE_INTERVAL 256 +typedef struct video_driver_ctx_msg_info +{ + const char *msg; + unsigned prio; + unsigned duration; + bool flush; +} video_driver_ctx_msg_info_t; + typedef struct video_pixel_scaler { struct scaler_ctx *scaler; @@ -138,8 +149,11 @@ static uint8_t *video_driver_record_gpu_buffer = NULL; #ifdef HAVE_THREADS static slock_t *display_lock = NULL; +static slock_t *_video_driver_msg_queue_lock = NULL; #endif +static msg_queue_t *video_driver_msg_queue = NULL; + struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END] = { { "4:3", 1.3333f }, { "16:9", 1.7778f }, @@ -944,7 +958,7 @@ void video_monitor_set_refresh_rate(float hz) snprintf(msg, sizeof(msg), "Setting refresh rate to: %.3f Hz.", hz); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); RARCH_LOG("%s\n", msg); settings->video.refresh_rate = hz; @@ -1540,10 +1554,87 @@ bool video_driver_get_prev_video_out(void) return true; } -bool video_driver_init(void) +static void video_driver_msg_queue_init(void) { + video_driver_msg_queue = msg_queue_new(8); + retro_assert(video_driver_msg_queue); + +#ifdef HAVE_THREADS + _video_driver_msg_queue_lock = slock_new(); + retro_assert(_video_driver_msg_queue_lock); +#endif +} + +static void video_driver_msg_queue_free(void) +{ +#ifdef HAVE_THREADS + slock_lock(_video_driver_msg_queue_lock); +#endif + + msg_queue_free(video_driver_msg_queue); + +#ifdef HAVE_THREADS + slock_unlock(_video_driver_msg_queue_lock); +#endif + +#ifdef HAVE_THREADS + slock_free(_video_driver_msg_queue_lock); + _video_driver_msg_queue_lock = NULL; +#endif + + video_driver_msg_queue = NULL; +} + +void video_driver_msg_queue_push(const char *msg, + unsigned prio, unsigned duration, + bool flush) +{ + video_driver_ctx_msg_info_t msg_info; + settings_t *settings = config_get_ptr(); + + if (!settings || !settings->video.font_enable) + return; + +#ifdef HAVE_THREADS + slock_lock(_video_driver_msg_queue_lock); +#endif + + if (flush) + msg_queue_clear(video_driver_msg_queue); + + msg_info.msg = msg; + msg_info.prio = prio; + msg_info.duration = duration; + msg_info.flush = flush; + + if (video_driver_msg_queue) + { + msg_queue_push(video_driver_msg_queue, msg_info.msg, + msg_info.prio, msg_info.duration); + + if (ui_companion_is_on_foreground()) + { + const ui_companion_driver_t *ui = ui_companion_get_ptr(); + if (ui->msg_queue_push) + ui->msg_queue_push(msg_info.msg, + msg_info.prio, msg_info.duration, msg_info.flush); + } + } + +#ifdef HAVE_THREADS + slock_unlock(_video_driver_msg_queue_lock); +#endif +} + +void video_driver_init(void) +{ + bool initialized = false; video_driver_lock_new(); - return init_video(); + + initialized = init_video(); + + if (initialized) + video_driver_msg_queue_init(); } void video_driver_destroy_data(void) @@ -1554,6 +1645,10 @@ void video_driver_destroy_data(void) void video_driver_deinit(void) { uninit_video_input(); + + if (video_driver_msg_queue) + video_driver_msg_queue_free(); + video_driver_lock_free(); video_driver_data = NULL; } @@ -2097,7 +2192,17 @@ void video_driver_frame(const void *data, unsigned width, video_driver_msg[0] = '\0'; - if (runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &msg) && msg) +#ifdef HAVE_THREADS + slock_lock(_video_driver_msg_queue_lock); +#endif + + msg = msg_queue_pull(video_driver_msg_queue); + +#ifdef HAVE_THREADS + slock_unlock(_video_driver_msg_queue_lock); +#endif + + if (msg) strlcpy(video_driver_msg, msg, sizeof(video_driver_msg)); if (!current_video || !current_video->frame( diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 62da274e59..89b277d27a 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -241,7 +241,7 @@ void video_driver_unset_rgba(void); bool video_driver_supports_rgba(void); bool video_driver_get_next_video_out(void); bool video_driver_get_prev_video_out(void); -bool video_driver_init(void); +void video_driver_init(void); void video_driver_destroy_data(void); void video_driver_deinit(void); void video_driver_monitor_reset(void); @@ -544,6 +544,10 @@ extern const void *frame_cache_data; extern void *video_driver_data; extern video_driver_t *current_video; +void video_driver_msg_queue_push(const char *msg, + unsigned prio, unsigned duration, + bool flush); + RETRO_END_DECLS #endif diff --git a/libretro-common/queues/task_queue.c b/libretro-common/queues/task_queue.c index 90675980ee..7bf33c4c09 100644 --- a/libretro-common/queues/task_queue.c +++ b/libretro-common/queues/task_queue.c @@ -56,7 +56,7 @@ static void task_queue_msg_push(unsigned prio, unsigned duration, bool flush, const char *fmt, ...) { #ifdef RARCH_INTERNAL - extern void runloop_msg_queue_push(const char *msg, unsigned prio, + extern void video_driver_msg_queue_push(const char *msg, unsigned prio, unsigned duration, bool flush); #endif char buf[1024]; @@ -72,7 +72,7 @@ static void task_queue_msg_push(unsigned prio, unsigned duration, #ifdef RARCH_INTERNAL /* TODO/FIXME - ugly */ - runloop_msg_queue_push(buf, prio, duration, flush); + video_driver_msg_queue_push(buf, prio, duration, flush); #endif } diff --git a/location/location_driver.c b/location/location_driver.c index 88baefea74..ee30073a10 100644 --- a/location/location_driver.c +++ b/location/location_driver.c @@ -30,6 +30,8 @@ #include "../list_special.h" #include "../verbosity.h" +#include "../gfx/video_driver.h" + static const location_driver_t *location_drivers[] = { #ifdef ANDROID &location_android, @@ -140,7 +142,7 @@ bool driver_location_start(void) if (settings->location.allow) return location_driver->start(location_data); - runloop_msg_queue_push("Location is explicitly disabled.\n", 1, 180, true); + video_driver_msg_queue_push("Location is explicitly disabled.\n", 1, 180, true); } return false; } diff --git a/managers/cheat_manager.c b/managers/cheat_manager.c index 42b53853a4..54a62d3e3c 100644 --- a/managers/cheat_manager.c +++ b/managers/cheat_manager.c @@ -38,6 +38,8 @@ #include "../core.h" #include "../verbosity.h" +#include "../gfx/video_driver.h" + struct item_cheat { char *desc; @@ -97,8 +99,9 @@ void cheat_manager_apply_cheats(void) core_set_cheat(&cheat_info); } } - runloop_msg_queue_push(msg_hash_to_str(MSG_APPLYING_CHEAT), 1, 180, true); - RARCH_LOG("%s\n", msg_hash_to_str(MSG_APPLYING_CHEAT)); + + video_driver_msg_queue_push(msg_hash_to_str(MSG_APPLYING_CHEAT), 1, 180, true); + RARCH_LOG("%s\n", msg_hash_to_str(MSG_APPLYING_CHEAT)); #ifdef HAVE_CHEEVOS data_bool = idx != 0; @@ -345,7 +348,7 @@ void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx) (handle->cheats[handle_idx].desc) ? (handle->cheats[handle_idx].desc) : (handle->cheats[handle_idx].code) ); - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); RARCH_LOG("%s\n", msg); } diff --git a/managers/state_manager.c b/managers/state_manager.c index 1118ddadae..0ff5042640 100644 --- a/managers/state_manager.c +++ b/managers/state_manager.c @@ -31,6 +31,7 @@ #include "../performance_counters.h" #include "../verbosity.h" #include "../audio/audio_driver.h" +#include "../gfx/video_driver.h" /* This makes Valgrind throw errors if a core overflows its savestate size. */ /* Keep it off unless you're chasing a core bug, it slows things down. */ @@ -588,7 +589,7 @@ void state_manager_check_rewind(bool pressed) audio_driver_setup_rewind(); - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_REWINDING), 0, runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL) ? 1 : 30, true); @@ -602,7 +603,7 @@ void state_manager_check_rewind(bool pressed) bsv_movie_ctl(BSV_MOVIE_CTL_FRAME_REWIND, NULL); } else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_REWIND_REACHED_END), 0, 30, true); } diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 4b6af02b32..35cffb5648 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -40,6 +40,7 @@ #include "../../core.h" #include "../../configuration.h" #include "../../core_info.h" +#include "../../gfx/video_driver.h" #include "../../frontend/frontend_driver.h" #include "../../defaults.h" #include "../../managers/cheat_manager.h" @@ -1339,7 +1340,7 @@ static int action_ok_playlist_entry_collection(const char *path, if (!menu_content_playlist_load(&playlist_info)) { - runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true); + video_driver_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true); return menu_cbs_exit(); } @@ -1426,7 +1427,7 @@ static int action_ok_playlist_entry(const char *path, if (!menu_content_playlist_load(&playlist_info)) { - runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true); + video_driver_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true); return menu_cbs_exit(); } @@ -1532,7 +1533,7 @@ static int action_ok_playlist_entry_start_content(const char *path, if (!menu_content_playlist_load(&playlist_info)) { - runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true); + video_driver_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true); return menu_cbs_exit(); } @@ -1691,11 +1692,11 @@ static void menu_input_st_string_cb_save_preset(void *userdata, ret = menu_shader_manager_save_preset(str, false, false); if(ret) - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY), 1, 100, true); else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET), 1, 100, true); } @@ -1774,11 +1775,11 @@ static int generic_action_ok_shader_preset_save(const char *path, } if(menu_shader_manager_save_preset(file, false, true)) - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY), 1, 100, true); else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET), 1, 100, true); @@ -1885,11 +1886,11 @@ static int generic_action_ok_remap_file_save(const char *path, path_mkdir(directory); if(input_remapping_save_file(file)) - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_REMAP_FILE_SAVED_SUCCESSFULLY), 1, 100, true); else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_ERROR_SAVING_REMAP_FILE), 1, 100, true); @@ -2684,7 +2685,7 @@ static int action_ok_option_create(const char *path, if (!retroarch_validate_game_options(game_path, sizeof(game_path), true)) { - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_ERROR_SAVING_CORE_OPTIONS_FILE), 1, 100, true); return 0; @@ -2701,7 +2702,7 @@ static int action_ok_option_create(const char *path, if(config_file_write(conf, game_path)) { - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_CORE_OPTIONS_FILE_CREATED_SUCCESSFULLY), 1, 100, true); path_set(RARCH_PATH_CORE_OPTIONS, game_path); @@ -3522,7 +3523,7 @@ static int action_ok_video_resolution(const char *path, snprintf(msg, sizeof(msg), "Applying: %dx%d\n START to reset", width, height); - runloop_msg_queue_push(msg, 1, 100, true); + video_driver_msg_queue_push(msg, 1, 100, true); } return 0; @@ -3539,7 +3540,7 @@ static int action_ok_netplay_enable_host(const char *path, /* If we haven't yet started, this will load on its own */ if (!content_is_inited()) { - runloop_msg_queue_push( + video_driver_msg_queue_push( "Netplay will start when content is loaded.", 1, 480, true); return 0; @@ -3570,7 +3571,7 @@ static int action_ok_netplay_enable_client(const char *path, /* We can't do anything without a host specified */ if (!settings->netplay.server[0]) { - runloop_msg_queue_push( + video_driver_msg_queue_push( "Please specify the Netplay server's IP address or hostname.", 1, 480, true); return -1; @@ -3579,7 +3580,7 @@ static int action_ok_netplay_enable_client(const char *path, /* If we haven't yet started, this will load on its own */ if (!content_is_inited()) { - runloop_msg_queue_push( + video_driver_msg_queue_push( "Netplay will start when content is loaded.", 1, 480, true); return 0; diff --git a/menu/cbs/menu_cbs_start.c b/menu/cbs/menu_cbs_start.c index 415c941208..0f2b3fc1fd 100644 --- a/menu/cbs/menu_cbs_start.c +++ b/menu/cbs/menu_cbs_start.c @@ -37,6 +37,7 @@ #include "../../runloop.h" #include "../../performance_counters.h" +#include "../../gfx/video_driver.h" #include "../../gfx/video_shader_driver.h" #include "../../input/input_remapping.h" @@ -321,7 +322,7 @@ static int action_start_video_resolution(unsigned type, const char *label) video_driver_set_video_mode(width, height, true); strlcpy(msg, "Resetting to: DEFAULT", sizeof(msg)); - runloop_msg_queue_push(msg, 1, 100, true); + video_driver_msg_queue_push(msg, 1, 100, true); } return 0; diff --git a/menu/drivers/xui.cpp b/menu/drivers/xui.cpp index dad913825a..7759bff4be 100644 --- a/menu/drivers/xui.cpp +++ b/menu/drivers/xui.cpp @@ -431,6 +431,7 @@ static void xui_frame(void *data) XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); +#if 0 runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message); if (message) @@ -442,6 +443,7 @@ static void xui_frame(void *data) if (message) xui_render_message(message); } +#endif XuiRenderEnd( app.GetDC() ); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 14e5f00c89..061aa33b7f 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -44,6 +44,7 @@ #endif +#include "../gfx/video_driver.h" #include "../frontend/frontend_driver.h" #include "widgets/menu_input_bind_dialog.h" @@ -1324,10 +1325,10 @@ static int setting_action_ok_bind_all_save_autoconfig(void *data, bool wraparoun if(config_save_autoconf_profile( settings->input.device_names[index_offset], index_offset)) - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_AUTOCONFIG_FILE_SAVED_SUCCESSFULLY), 1, 100, true); else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_AUTOCONFIG_FILE_ERROR_SAVING), 1, 100, true); return 0; diff --git a/movie.c b/movie.c index 7a5d2b97db..499bd7d7e3 100644 --- a/movie.c +++ b/movie.c @@ -31,6 +31,8 @@ #include "msg_hash.h" #include "verbosity.h" +#include "gfx/video_driver.h" + #include "command.h" #include "file_path_special.h" @@ -319,7 +321,7 @@ static void bsv_movie_init_state(void) } bsv_movie_state.movie_playback = true; - runloop_msg_queue_push(msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK), + video_driver_msg_queue_push(msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK), 2, 180, false); RARCH_LOG("%s.\n", msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK)); settings->rewind_granularity = 1; @@ -335,14 +337,14 @@ static void bsv_movie_init_state(void) if (!(bsv_movie_init_handle(bsv_movie_state.movie_start_path, RARCH_MOVIE_RECORD))) { - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD), 1, 180, true); RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD)); return; } - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); RARCH_LOG("%s \"%s\".\n", msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO), bsv_movie_state.movie_start_path); @@ -468,7 +470,7 @@ static bool runloop_check_movie_playback(void) if (!bsv_movie_ctl(BSV_MOVIE_CTL_END, NULL)) return false; - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_MOVIE_PLAYBACK_ENDED), 2, 180, false); RARCH_LOG("%s\n", msg_hash_to_str(MSG_MOVIE_PLAYBACK_ENDED)); @@ -486,7 +488,7 @@ static bool runloop_check_movie_record(void) if (!bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL)) return false; - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_MOVIE_RECORD_STOPPED), 2, 180, true); RARCH_LOG("%s\n", msg_hash_to_str(MSG_MOVIE_RECORD_STOPPED)); @@ -527,14 +529,14 @@ static bool runloop_check_movie_init(void) if (bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL)) { - runloop_msg_queue_push(msg, 2, 180, true); + video_driver_msg_queue_push(msg, 2, 180, true); RARCH_LOG("%s \"%s\".\n", msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO), path); } else { - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD), 2, 180, true); RARCH_ERR("%s\n", diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index dbce355939..04e0ac3e1b 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -26,7 +26,7 @@ #include "../../configuration.h" #include "../../input/input_driver.h" -#include "../../runloop.h" +#include "../../gfx/video_driver.h" /* Only used before init_netplay */ static bool netplay_enabled = false; @@ -424,7 +424,7 @@ bool netplay_command(netplay_t* netplay, struct netplay_connection *connection, if (!netplay_send_raw_cmd(netplay, connection, cmd, data, sz)) return false; - runloop_msg_queue_push(success_msg, 1, 180, false); + video_driver_msg_queue_push(success_msg, 1, 180, false); return true; } @@ -781,7 +781,7 @@ static void netplay_toggle_play_spectate(netplay_t *netplay) } RARCH_LOG("%s\n", dmsg); - runloop_msg_queue_push(dmsg, 1, 180, false); + video_driver_msg_queue_push(dmsg, 1, 180, false); netplay_send_raw_cmd_all(netplay, NULL, NETPLAY_CMD_MODE, payload, sizeof(payload)); @@ -884,7 +884,7 @@ bool init_netplay(void *direct_host, const char *server, unsigned port) else { RARCH_LOG("%s\n", msg_hash_to_str(MSG_WAITING_FOR_CLIENT)); - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_WAITING_FOR_CLIENT), 0, 180, false); } @@ -902,7 +902,7 @@ bool init_netplay(void *direct_host, const char *server, unsigned port) RARCH_WARN("%s\n", msg_hash_to_str(MSG_NETPLAY_FAILED)); - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_NETPLAY_FAILED), 0, 180, false); return false; diff --git a/network/netplay/netplay_handshake.c b/network/netplay/netplay_handshake.c index 910508a0a1..3ccf57a3fa 100644 --- a/network/netplay/netplay_handshake.c +++ b/network/netplay/netplay_handshake.c @@ -27,6 +27,7 @@ #include "../../configuration.h" #include "../../content.h" +#include "../../gfx/video_driver.h" #include "../../retroarch.h" #include "../../runloop.h" #include "../../version.h" @@ -90,14 +91,14 @@ void netplay_log_connection(const struct sockaddr_storage *their_addr, { snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_GOT_CONNECTION_FROM_NAME), nick, str); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); RARCH_LOG("%s\n", msg); } else { snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_GOT_CONNECTION_FROM), nick); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); RARCH_LOG("%s\n", msg); } RARCH_LOG("%s %u\n", msg_hash_to_str(MSG_CONNECTION_SLOT), @@ -114,7 +115,7 @@ void netplay_log_connection(const struct sockaddr_storage *their_addr, snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_GOT_CONNECTION_FROM), nick); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); RARCH_LOG("%s\n", msg); RARCH_LOG("%s %u\n", msg_hash_to_str(MSG_CONNECTION_SLOT), slot); @@ -411,7 +412,7 @@ error: if (dmsg) { RARCH_ERR("%s\n", dmsg); - runloop_msg_queue_push(dmsg, 1, 180, false); + video_driver_msg_queue_push(dmsg, 1, 180, false); } return false; } @@ -436,7 +437,7 @@ static void netplay_handshake_ready(netplay_t *netplay, struct netplay_connectio msg_hash_to_str(MSG_CONNECTED_TO), connection->nick); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); } /* Unstall if we were waiting for this */ @@ -622,7 +623,7 @@ bool netplay_handshake_pre_nick(netplay_t *netplay, msg_hash_to_str(MSG_FAILED_TO_RECEIVE_NICKNAME_FROM_HOST), sizeof(msg)); RARCH_ERR("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); return false; } @@ -691,7 +692,7 @@ bool netplay_handshake_pre_password(netplay_t *netplay, msg_hash_to_str(MSG_FAILED_TO_RECEIVE_NICKNAME_FROM_HOST), sizeof(msg)); RARCH_ERR("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); return false; } @@ -822,7 +823,7 @@ error: if (dmsg) { RARCH_ERR("%s\n", dmsg); - runloop_msg_queue_push(dmsg, 1, 180, false); + video_driver_msg_queue_push(dmsg, 1, 180, false); } return false; } @@ -849,7 +850,7 @@ bool netplay_handshake_pre_sync(netplay_t *netplay, { const char *msg = msg_hash_to_str(MSG_NETPLAY_INCORRECT_PASSWORD); RARCH_ERR("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); return false; } @@ -934,7 +935,7 @@ bool netplay_handshake_pre_sync(netplay_t *netplay, strlcpy(netplay->nick, new_nick, NETPLAY_NICK_LEN); snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_NETPLAY_CHANGED_NICK), netplay->nick); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); } /* Now check the SRAM */ diff --git a/network/netplay/netplay_io.c b/network/netplay/netplay_io.c index 956a9a7d4d..c1da832a62 100644 --- a/network/netplay/netplay_io.c +++ b/network/netplay/netplay_io.c @@ -24,7 +24,7 @@ #include "netplay_private.h" -#include "../../runloop.h" +#include "../../gfx/video_driver.h" #if 0 #define DEBUG_NETPLAY_STEPS 1 @@ -111,7 +111,7 @@ void netplay_hangup(netplay_t *netplay, struct netplay_connection *connection) dmsg = msg_hash_to_str(MSG_NETPLAY_CLIENT_HANGUP); } RARCH_LOG("%s\n", dmsg); - runloop_msg_queue_push(dmsg, 1, 180, false); + video_driver_msg_queue_push(dmsg, 1, 180, false); socket_close(connection->fd); connection->active = false; @@ -576,7 +576,7 @@ static bool netplay_get_cmd(netplay_t *netplay, netplay->force_rewind = true; RARCH_LOG("%s.\n", msg_hash_to_str(MSG_NETPLAY_USERS_HAS_FLIPPED)); - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_NETPLAY_USERS_HAS_FLIPPED), 1, 180, false); break; @@ -608,7 +608,7 @@ static bool netplay_get_cmd(netplay_t *netplay, msg[sizeof(msg)-1] = '\0'; snprintf(msg, sizeof(msg)-1, "Player %d has left", connection->player+1); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); } else { @@ -672,8 +672,7 @@ static bool netplay_get_cmd(netplay_t *netplay, msg[sizeof(msg)-1] = '\0'; snprintf(msg, sizeof(msg)-1, "Player %d has joined", player+1); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); - + video_driver_msg_queue_push(msg, 1, 180, false); } /* Tell the player even if they were confused */ @@ -805,7 +804,7 @@ static bool netplay_get_cmd(netplay_t *netplay, msg[sizeof(msg)-1] = '\0'; snprintf(msg, sizeof(msg)-1, "You have joined as player %d", player+1); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); #ifdef DEBUG_NETPLAY_STEPS RARCH_LOG("Received mode change self->%u\n", player); @@ -825,7 +824,7 @@ static bool netplay_get_cmd(netplay_t *netplay, /* Announce it */ strlcpy(msg, "You have left the game", sizeof(msg)); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); #ifdef DEBUG_NETPLAY_STEPS RARCH_LOG("Received mode change %u self->spectating\n", netplay->self_player); @@ -855,7 +854,7 @@ static bool netplay_get_cmd(netplay_t *netplay, msg[sizeof(msg)-1] = '\0'; snprintf(msg, sizeof(msg)-1, "Player %d has joined", player+1); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); #ifdef DEBUG_NETPLAY_STEPS RARCH_LOG("Received mode change spectator->%u\n", player); @@ -871,7 +870,7 @@ static bool netplay_get_cmd(netplay_t *netplay, msg[sizeof(msg)-1] = '\0'; snprintf(msg, sizeof(msg)-1, "Player %d has left", player+1); RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); #ifdef DEBUG_NETPLAY_STEPS RARCH_LOG("Received mode change %u->spectator\n", player); @@ -929,7 +928,7 @@ static bool netplay_get_cmd(netplay_t *netplay, if (dmsg) { RARCH_LOG("%s\n", dmsg); - runloop_msg_queue_push(dmsg, 1, 180, false); + video_driver_msg_queue_push(dmsg, 1, 180, false); } break; } @@ -1191,7 +1190,7 @@ static bool netplay_get_cmd(netplay_t *netplay, snprintf(msg, sizeof(msg)-1, msg_hash_to_str(MSG_NETPLAY_PEER_PAUSED), nick); } RARCH_LOG("%s\n", msg); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); break; } @@ -1343,7 +1342,7 @@ void netplay_announce_nat_traversal(netplay_t *netplay) snprintf(msg, sizeof(msg), "%s: %s:%s\n", msg_hash_to_str(MSG_PUBLIC_ADDRESS), host, port); - runloop_msg_queue_push(msg, 1, 180, false); + video_driver_msg_queue_push(msg, 1, 180, false); RARCH_LOG("%s\n", msg); #endif } diff --git a/record/record_driver.c b/record/record_driver.c index 8dbfffb8fa..fd3154c1eb 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -35,6 +35,7 @@ #include "../msg_hash.h" #include "../list_special.h" +#include "../gfx/video_driver.h" static const record_driver_t *record_drivers[] = { #ifdef HAVE_FFMPEG @@ -215,7 +216,7 @@ void recording_dump_frame(const void *data, unsigned width, { RARCH_WARN("%s\n", msg_hash_to_str(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE)); - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE), 1, 180, true); command_event(CMD_EVENT_RECORD_DEINIT, NULL); diff --git a/retroarch.c b/retroarch.c index 2fe95be733..fd78812642 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1174,7 +1174,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) rarch_block_config_read = false; rarch_force_fullscreen = false; - runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL); driver_ctl(RARCH_DRIVER_CTL_UNINIT_ALL, NULL); command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL); @@ -1240,7 +1239,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) settings->input.libretro_device[i] = RETRO_DEVICE_JOYPAD; } runloop_ctl(RUNLOOP_CTL_HTTPSERVER_INIT, NULL); - runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_INIT, NULL); break; case RARCH_CTL_SET_PATHS_REDIRECT: if (content_does_not_need_content()) diff --git a/runloop.c b/runloop.c index c05f34aa65..841ef8755e 100644 --- a/runloop.c +++ b/runloop.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -101,23 +100,11 @@ enum runloop_state RUNLOOP_STATE_QUIT }; -typedef struct runloop_ctx_msg_info -{ - const char *msg; - unsigned prio; - unsigned duration; - bool flush; -} runloop_ctx_msg_info_t; - static rarch_system_info_t runloop_system; static struct retro_frame_time_callback runloop_frame_time; static retro_keyboard_event_t runloop_key_event = NULL; static retro_keyboard_event_t runloop_frontend_key_event = NULL; static core_option_manager_t *runloop_core_options = NULL; -#ifdef HAVE_THREADS -static slock_t *_runloop_msg_queue_lock = NULL; -#endif -static msg_queue_t *runloop_msg_queue = NULL; static unsigned runloop_pending_windowed_scale = 0; static retro_usec_t runloop_frame_time_last = 0; static unsigned runloop_max_frames = false; @@ -141,47 +128,6 @@ global_t *global_get_ptr(void) return &g_extern; } -void runloop_msg_queue_push(const char *msg, - unsigned prio, unsigned duration, - bool flush) -{ - runloop_ctx_msg_info_t msg_info; - settings_t *settings = config_get_ptr(); - - if (!settings || !settings->video.font_enable) - return; - -#ifdef HAVE_THREADS - slock_lock(_runloop_msg_queue_lock); -#endif - - if (flush) - msg_queue_clear(runloop_msg_queue); - - msg_info.msg = msg; - msg_info.prio = prio; - msg_info.duration = duration; - msg_info.flush = flush; - - if (runloop_msg_queue) - { - msg_queue_push(runloop_msg_queue, msg_info.msg, - msg_info.prio, msg_info.duration); - - if (ui_companion_is_on_foreground()) - { - const ui_companion_driver_t *ui = ui_companion_get_ptr(); - if (ui->msg_queue_push) - ui->msg_queue_push(msg_info.msg, - msg_info.prio, msg_info.duration, msg_info.flush); - } - } - -#ifdef HAVE_THREADS - slock_unlock(_runloop_msg_queue_lock); -#endif -} - #ifdef HAVE_MENU static bool runloop_cmd_get_state_menu_toggle_button_combo( settings_t *settings, @@ -510,56 +456,6 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data) break; case RUNLOOP_CTL_IS_PAUSED: return runloop_paused; - case RUNLOOP_CTL_MSG_QUEUE_PULL: -#ifdef HAVE_THREADS - slock_lock(_runloop_msg_queue_lock); -#endif - { - const char **ret = (const char**)data; - if (!ret) - { -#ifdef HAVE_THREADS - slock_unlock(_runloop_msg_queue_lock); -#endif - return false; - } - *ret = msg_queue_pull(runloop_msg_queue); - } -#ifdef HAVE_THREADS - slock_unlock(_runloop_msg_queue_lock); -#endif - break; - case RUNLOOP_CTL_MSG_QUEUE_DEINIT: - if (!runloop_msg_queue) - return true; - -#ifdef HAVE_THREADS - slock_lock(_runloop_msg_queue_lock); -#endif - - msg_queue_free(runloop_msg_queue); - -#ifdef HAVE_THREADS - slock_unlock(_runloop_msg_queue_lock); -#endif - -#ifdef HAVE_THREADS - slock_free(_runloop_msg_queue_lock); - _runloop_msg_queue_lock = NULL; -#endif - - runloop_msg_queue = NULL; - break; - case RUNLOOP_CTL_MSG_QUEUE_INIT: - runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL); - runloop_msg_queue = msg_queue_new(8); - retro_assert(runloop_msg_queue); - -#ifdef HAVE_THREADS - _runloop_msg_queue_lock = slock_new(); - retro_assert(_runloop_msg_queue_lock); -#endif - break; case RUNLOOP_CTL_TASK_INIT: { #ifdef HAVE_THREADS @@ -1001,7 +897,7 @@ static enum runloop_state runloop_check_state( msg_hash_to_str(MSG_STATE_SLOT), settings->state_slot); - runloop_msg_queue_push(msg, 2, 180, true); + video_driver_msg_queue_push(msg, 2, 180, true); RARCH_LOG("%s\n", msg); } @@ -1018,7 +914,7 @@ static enum runloop_state runloop_check_state( msg_hash_to_str(MSG_STATE_SLOT), settings->state_slot); - runloop_msg_queue_push(msg, 2, 180, true); + video_driver_msg_queue_push(msg, 2, 180, true); RARCH_LOG("%s\n", msg); } @@ -1045,10 +941,10 @@ static enum runloop_state runloop_check_state( } if (state_manager_frame_is_reversed()) - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_SLOW_MOTION_REWIND), 2, 30, true); else - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_SLOW_MOTION), 2, 30, true); } diff --git a/runloop.h b/runloop.h index d696a50dc1..1e42ab8b8e 100644 --- a/runloop.h +++ b/runloop.h @@ -93,11 +93,6 @@ enum runloop_ctl_state RUNLOOP_CTL_KEY_EVENT_GET, RUNLOOP_CTL_DATA_DEINIT, - /* Message queue */ - RUNLOOP_CTL_MSG_QUEUE_INIT, - RUNLOOP_CTL_MSG_QUEUE_DEINIT, - RUNLOOP_CTL_MSG_QUEUE_PULL, - /* Core options */ RUNLOOP_CTL_HAS_CORE_OPTIONS, RUNLOOP_CTL_GET_CORE_OPTION_SIZE, @@ -203,9 +198,6 @@ global_t *global_get_ptr(void); **/ int runloop_iterate(unsigned *sleep_ms); -void runloop_msg_queue_push(const char *msg, unsigned prio, - unsigned duration, bool flush); - bool runloop_ctl(enum runloop_ctl_state state, void *data); RETRO_END_DECLS diff --git a/tasks/task_content.c b/tasks/task_content.c index 2201c55fad..fb9b5085fb 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -76,6 +76,7 @@ #include "../configuration.h" #include "../defaults.h" #include "../frontend/frontend.h" +#include "../gfx/video_driver.h" #include "../playlist.h" #include "../paths.h" #include "../retroarch.h" @@ -1271,7 +1272,7 @@ error: if (error_string) { - runloop_msg_queue_push(error_string, 2, 90, true); + video_driver_msg_queue_push(error_string, 2, 90, true); free(error_string); } @@ -1299,7 +1300,7 @@ error: return false; skip: - runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 100, 500, true); + video_driver_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 100, 500, true); RARCH_LOG("Load content blocked. Reason: %s\n", msg_hash_to_str(MSG_FIRMWARE)); return true; @@ -1441,7 +1442,7 @@ end: { RARCH_ERR("%s\n", error_string); } - runloop_msg_queue_push(error_string, 2, ret ? 1 : 180, true); + video_driver_msg_queue_push(error_string, 2, ret ? 1 : 180, true); free(error_string); } diff --git a/tasks/task_database.c b/tasks/task_database.c index 446ebd81a7..66f97f973c 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -28,6 +28,7 @@ #include "tasks_internal.h" #include "../database_info.h" +#include "../gfx/video_driver.h" #include "../configuration.h" #include "../file_path_special.h" @@ -111,7 +112,7 @@ static int task_database_iterate_start(database_info_handle_t *db, name); if (!string_is_empty(msg)) - runloop_msg_queue_push(msg, 1, 180, true); + video_driver_msg_queue_push(msg, 1, 180, true); #if 0 RARCH_LOG("msg: %s\n", msg); @@ -656,7 +657,7 @@ static void task_database_handler(retro_task_t *task) } else { - runloop_msg_queue_push( + video_driver_msg_queue_push( msg_hash_to_str(MSG_SCANNING_OF_DIRECTORY_FINISHED), 0, 180, true); goto task_finished; diff --git a/tasks/task_save.c b/tasks/task_save.c index 900c034269..b31574b542 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -48,6 +48,7 @@ #include "../configuration.h" #include "../msg_hash.h" #include "../retroarch.h" +#include "../gfx/video_driver.h" #include "../runloop.h" #include "../verbosity.h" #include "tasks_internal.h" @@ -967,7 +968,7 @@ error: load_data->path); if (!load_data->mute) - runloop_msg_queue_push(err_buf, 1, 180, true); + video_driver_msg_queue_push(err_buf, 1, 180, true); RARCH_ERR("%s \"%s\".\n", msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE), diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 87058af37f..f7afa6c11a 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -176,7 +176,7 @@ static void task_screenshot_handler(retro_task_t *task) if (!ret) { char *msg = strdup(msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT)); - runloop_msg_queue_push(msg, 1, is_paused ? 1 : 180, true); + video_driver_msg_queue_push(msg, 1, is_paused ? 1 : 180, true); free(msg); } } diff --git a/wifi/drivers/connmanctl.c b/wifi/drivers/connmanctl.c index 3f78ee3565..61c4e0066b 100644 --- a/wifi/drivers/connmanctl.c +++ b/wifi/drivers/connmanctl.c @@ -19,6 +19,8 @@ #include #include "../wifi_driver.h" + +#include "../../gfx/video_driver.h" #include "../../runloop.h" #include "../../lakka.h" @@ -62,7 +64,7 @@ static void connmanctl_scan(void) pclose(popen("connmanctl scan wifi", "r")); - runloop_msg_queue_push("Wi-Fi scan complete.", 1, 180, true); + video_driver_msg_queue_push("Wi-Fi scan complete.", 1, 180, true); serv_file = popen("connmanctl services", "r"); while (fgets (line, 512, serv_file) != NULL) @@ -213,9 +215,8 @@ static bool connmanctl_connect_ssid(unsigned i, const char* passphrase) command_file = popen(command, "r"); while (fgets (ln, 512, command_file) != NULL) - { - runloop_msg_queue_push(ln, 1, 180, true); - } + video_driver_msg_queue_push(ln, 1, 180, true); + pclose(command_file); return true;