Revert "Rename runloop_msg_queue_push to video_driver_msg_queue_push"

This reverts commit ad7386913c.
This commit is contained in:
twinaphex 2016-12-22 23:36:11 +01:00
parent b07fd17258
commit 77e5cdbfde
50 changed files with 261 additions and 305 deletions

View File

@ -29,8 +29,6 @@
#include "../list_special.h"
#include "../verbosity.h"
#include "../gfx/video_driver.h"
static const camera_driver_t *camera_drivers[] = {
#ifdef HAVE_V4L2
&camera_v4l2,
@ -193,7 +191,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
if (settings->camera.allow)
return camera_driver->start(camera_data);
video_driver_msg_queue_push(
runloop_msg_queue_push(
"Camera is explicitly disabled.\n", 1, 180, false);
}
break;

View File

@ -34,7 +34,6 @@
#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"
@ -1832,8 +1831,8 @@ static int cheevos_login(retro_time_t *timeout)
if (!username || !*username || !password || !*password)
{
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);
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);
RARCH_ERR("CHEEVOS username and/or password not informed.\n");
return -1;
}
@ -1864,7 +1863,7 @@ static int cheevos_login(retro_time_t *timeout)
return 0;
}
video_driver_msg_queue_push("Retro Achievements login error.",
runloop_msg_queue_push("Retro Achievements login error.",
0, 5 * 60, false);
RARCH_ERR("CHEEVOS error getting user token.\n");
return -1;
@ -1939,8 +1938,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);
video_driver_msg_queue_push(cheevo->title, 0, 3 * 60, false);
video_driver_msg_queue_push(cheevo->description, 0, 5 * 60, false);
runloop_msg_queue_push(cheevo->title, 0, 3 * 60, false);
runloop_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);
@ -2688,7 +2687,7 @@ found:
free((void*)json);
}
video_driver_msg_queue_push("Error loading achievements.", 0, 5 * 60, false);
runloop_msg_queue_push("Error loading achievements.", 0, 5 * 60, false);
RARCH_ERR("CHEEVOS error loading achievements.\n");
return false;
}
@ -2861,7 +2860,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));
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_CHEEVOS_HARDCORE_MODE_ENABLE), 0, 3 * 60, true);
}
else

View File

@ -65,7 +65,6 @@
#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"
@ -186,7 +185,7 @@ static bool command_set_shader(const char *arg)
}
snprintf(msg, sizeof(msg), "Shader: \"%s\"", arg);
video_driver_msg_queue_push(msg, 1, 120, true);
runloop_msg_queue_push(msg, 1, 120, true);
RARCH_LOG("%s \"%s\".\n",
msg_hash_to_str(MSG_APPLYING_SHADER),
arg);
@ -890,7 +889,7 @@ static void command_event_disk_control_set_eject(bool new_state, bool print_log)
/* Only noise in menu. */
if (print_log)
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
}
}
@ -950,7 +949,7 @@ static void command_event_disk_control_set_index(unsigned idx)
RARCH_ERR("%s\n", msg);
else
RARCH_LOG("%s\n", msg);
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
}
}
@ -993,7 +992,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);
video_driver_msg_queue_push(msg, 0, 180, true);
runloop_msg_queue_push(msg, 0, 180, true);
command_event(CMD_EVENT_AUTOSAVE_DEINIT, NULL);
@ -1100,7 +1099,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);
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
RARCH_LOG("%s\n", msg);
audio_driver_set_volume_gain(db_to_gain(settings->audio.volume));
@ -1512,7 +1511,7 @@ static bool command_event_save_core_config(void)
sizeof(config_dir));
else
{
video_driver_msg_queue_push(msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET), 1, 180, true);
runloop_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;
}
@ -1577,7 +1576,7 @@ static bool command_event_save_core_config(void)
command_event_save_config(config_path, msg, sizeof(msg));
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
if (overrides_active)
runloop_ctl(RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, NULL);
@ -1617,7 +1616,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))
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
}
static void command_event_undo_save_state(char *s, size_t len)
@ -1710,7 +1709,7 @@ static void command_event_main_state(unsigned cmd)
MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES), sizeof(msg));
if (push_msg)
video_driver_msg_queue_push(msg, 2, 180, true);
runloop_msg_queue_push(msg, 2, 180, true);
RARCH_LOG("%s\n", msg);
}
@ -1779,7 +1778,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);
video_driver_msg_queue_push(msg, 1, 100, true);
runloop_msg_queue_push(msg, 1, 100, true);
}
}
#endif
@ -1874,7 +1873,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));
video_driver_msg_queue_push(msg_hash_to_str(MSG_RESET), 1, 120, true);
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET), 1, 120, true);
#ifdef HAVE_CHEEVOS
cheevos_set_cheats();
@ -2032,7 +2031,7 @@ bool command_event(enum event_command cmd, void *data)
return false;
}
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
RARCH_LOG("%s\n", msg);
}
break;
@ -2225,7 +2224,7 @@ bool command_event(enum event_command cmd, void *data)
break;
case CMD_EVENT_SHUTDOWN:
#if defined(__linux__) && !defined(ANDROID)
video_driver_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true);
runloop_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");
@ -2233,7 +2232,7 @@ bool command_event(enum event_command cmd, void *data)
break;
case CMD_EVENT_REBOOT:
#if defined(__linux__) && !defined(ANDROID)
video_driver_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true);
runloop_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");
@ -2278,7 +2277,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);
video_driver_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1, is_paused ? 1: 30, true);
runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1, is_paused ? 1: 30, true);
if (settings->video.black_frame_insertion || is_paused)
{
@ -2426,7 +2425,7 @@ bool command_event(enum event_command cmd, void *data)
}
}
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS),
1, 120, true);
break;
@ -2446,7 +2445,7 @@ bool command_event(enum event_command cmd, void *data)
command_event_check_disk_next(control);
}
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS),
1, 120, true);
break;
@ -2466,7 +2465,7 @@ bool command_event(enum event_command cmd, void *data)
command_event_check_disk_prev(control);
}
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS),
1, 120, true);
break;
@ -2527,7 +2526,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)
video_driver_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_ON),
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_ON),
1, 120, true);
}
else
@ -2537,7 +2536,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)
video_driver_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_OFF),
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_OFF),
1, 120, true);
}

View File

@ -32,7 +32,6 @@
#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"
@ -2321,7 +2320,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);
video_driver_msg_queue_push("Configuration override loaded.", 1, 100, true);
runloop_msg_queue_push("Configuration override loaded.", 1, 100, true);
/* Reset save paths. */
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
@ -2428,7 +2427,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))
{
video_driver_msg_queue_push("Game remap file loaded.", 1, 100, true);
runloop_msg_queue_push("Game remap file loaded.", 1, 100, true);
return true;
}
}
@ -2447,7 +2446,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))
{
video_driver_msg_queue_push("Core remap file loaded.", 1, 100, true);
runloop_msg_queue_push("Core remap file loaded.", 1, 100, true);
return true;
}
}

4
dirs.c
View File

@ -34,8 +34,6 @@
#include "runloop.h"
#include "verbosity.h"
#include "gfx/video_driver.h"
struct rarch_dir_list
{
struct string_list *list;
@ -158,7 +156,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);
video_driver_msg_queue_push(msg, 2, 120, true);
runloop_msg_queue_push(msg, 2, 120, true);
RARCH_LOG("%s \"%s\".\n",
msg_hash_to_str(MSG_APPLYING_SHADER),

View File

@ -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())
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT),
2, 180, false);
command_event(CMD_EVENT_RECORD_DEINIT, NULL);

View File

@ -50,7 +50,6 @@
#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"
@ -252,7 +251,7 @@ static bool load_dynamic_core(void)
path_get(RARCH_PATH_CORE));
RARCH_ERR("Error(s): %s\n", dylib_error());
video_driver_msg_queue_push(msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE), 1, 180, true);
runloop_msg_queue_push(msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE), 1, 180, true);
return false;
}
@ -1011,7 +1010,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);
video_driver_msg_queue_push(msg->msg, 3, msg->frames, true);
runloop_msg_queue_push(msg->msg, 3, msg->frames, true);
break;
}

View File

@ -32,7 +32,6 @@
#include "../../input/common/input_x11_common.h"
#include "../../configuration.h"
#include "../../verbosity.h"
#include "../../gfx/video_driver.h"
#include "../../runloop.h"
#ifdef HAVE_DBUS
@ -731,7 +730,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
bool x11_input_ctx_new(bool true_full)

View File

@ -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));
video_driver_msg_queue_push(buffer_fps, 1, 1, false);
runloop_msg_queue_push(buffer_fps, 1, 1, false);
}
/* If at this point the dimension parameters are still zero, setup some *

View File

@ -30,7 +30,6 @@
#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"
@ -213,7 +212,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));
video_driver_msg_queue_push(buffer_fps, 1, 1, false);
runloop_msg_queue_push(buffer_fps, 1, 1, false);
}
#ifdef HAVE_OVERLAY

View File

@ -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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static bool android_gfx_ctx_set_video_mode(void *data,

View File

@ -42,7 +42,6 @@
#include "../common/gl_common.h"
#endif
#include "../video_driver.h"
#include "../../configuration.h"
#include "../../runloop.h"
@ -304,7 +303,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static bool gfx_ctx_qnx_set_video_mode(void *data,

View File

@ -32,7 +32,6 @@
#include "../../configuration.h"
#include "../../runloop.h"
#include "../../configuration.h"
#include "../video_driver.h"
#include "../video_context_driver.h"
typedef int CGSConnectionID;
@ -125,7 +124,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}

View File

@ -39,7 +39,6 @@
#include <compat/apple_compat.h>
#import "../../ui/drivers/cocoa/cocoa_common.h"
#include "../video_driver.h"
#include "../video_context_driver.h"
#include "../../configuration.h"
#include "../../runloop.h"
@ -437,7 +436,7 @@ static void cocoagl_gfx_ctx_update_window_title(void *data)
window->set_title(&view, buf);
#endif
if (settings->fps_show)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static bool cocoagl_gfx_ctx_get_metrics(void *data, enum display_metric_types type,

View File

@ -26,7 +26,6 @@
#include <compat/strl.h>
#include "../video_driver.h"
#include "../drivers/d3d.h"
#include "../common/win32_common.h"
@ -116,7 +115,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
video_driver_msg_queue_push(buffer_fps, 1, 1, false);
runloop_msg_queue_push(buffer_fps, 1, 1, false);
}
}

View File

@ -35,7 +35,6 @@
#include <lists/dir_list.h>
#include <streams/file_stream.h>
#include "../video_driver.h"
#include "../../verbosity.h"
#include "../../configuration.h"
#include "../../runloop.h"
@ -284,7 +283,7 @@ static void gfx_ctx_drm_update_window_title(void *data)
buf_fps, sizeof(buf_fps));
if (settings->fps_show)
video_driver_msg_queue_push( buf_fps, 1, 1, false);
runloop_msg_queue_push( buf_fps, 1, 1, false);
}
static void gfx_ctx_drm_get_video_size(void *data,

View File

@ -26,7 +26,6 @@
#include "../../configuration.h"
#include "../../runloop.h"
#include "../video_driver.h"
#include "../video_context_driver.h"
#ifdef HAVE_EGL
@ -98,18 +97,16 @@ static bool gfx_ctx_emscripten_set_resize(void *data,
static void gfx_ctx_emscripten_update_window_title(void *data)
{
char buf[128];
char buf_fps[128];
char buf[128] = {0};
char buf_fps[128] = {0};
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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static void gfx_ctx_emscripten_get_video_size(void *data,

View File

@ -17,7 +17,6 @@
#include "../../config.h"
#endif
#include "../video_driver.h"
#include "../../configuration.h"
#include "../../runloop.h"
#include "../../frontend/frontend_driver.h"
@ -125,7 +124,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static bool gfx_ctx_khr_display_set_video_mode(void *data,

View File

@ -36,7 +36,6 @@
#include "../common/gl_common.h"
#endif
#include "../video_driver.h"
#include "../../frontend/frontend_driver.h"
#include "../../configuration.h"
#include "../../runloop.h"
@ -171,7 +170,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static bool gfx_ctx_mali_fbdev_set_video_mode(void *data,

View File

@ -28,7 +28,6 @@
#include "../common/gl_common.h"
#endif
#include "../video_driver.h"
#include "../../frontend/frontend_driver.h"
#include "../../configuration.h"
#include "../../runloop.h"
@ -154,7 +153,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static bool gfx_ctx_opendingux_set_video_mode(void *data,

View File

@ -29,7 +29,6 @@
#include <GL/osmesa.h>
#include "../video_driver.h"
#include "../../runloop.h"
#include "../common/gl_common.h"
@ -312,8 +311,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;
@ -321,7 +320,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static void osmesa_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width,

View File

@ -29,7 +29,6 @@
#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
@ -212,7 +211,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static void gfx_ctx_ps3_get_video_size(void *data,

View File

@ -289,7 +289,7 @@ static void sdl_ctx_update_window_title(void *data)
#endif
}
if (settings->fps_show)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width,

View File

@ -30,7 +30,6 @@
#include <retro_inline.h>
#include "../video_driver.h"
#include "../../configuration.h"
#include "../../runloop.h"
#include "../video_context_driver.h"
@ -108,18 +107,16 @@ 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];
char buf_fps[128];
char buf[128] = {0};
char buf_fps[128] = {0};
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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static void gfx_ctx_vc_get_video_size(void *data,

View File

@ -148,18 +148,16 @@ static bool gfx_ctx_vivante_set_resize(void *data,
static void gfx_ctx_vivante_update_window_title(void *data)
{
char buf[128];
char buf_fps[128];
char buf[128] = {0};
char buf_fps[128] = {0};
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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static bool gfx_ctx_vivante_set_video_mode(void *data,

View File

@ -22,8 +22,6 @@
#include <string/stdstring.h>
#include <linux/input.h>
#ifdef HAVE_CONFIG_H
#include "../../config.h"
#endif
@ -44,13 +42,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 <linux/input.h>
typedef struct gfx_ctx_wayland_data
{
@ -736,7 +734,7 @@ static void gfx_ctx_wl_update_window_title(void *data)
wl_shell_surface_set_title(wl->shell_surf, buf);
if (settings->fps_show)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}

View File

@ -42,7 +42,6 @@
#include "../../configuration.h"
#include "../../dynamic.h"
#include "../../runloop.h"
#include "../video_driver.h"
#include "../video_context_driver.h"
#include "../common/win32_common.h"
@ -400,7 +399,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)
video_driver_msg_queue_push(buf_fps, 1, 1, false);
runloop_msg_queue_push(buf_fps, 1, 1, false);
}
static void gfx_ctx_wgl_get_video_size(void *data,

View File

@ -27,7 +27,6 @@
#include <gfx/scaler/pixconv.h>
#include <gfx/scaler/scaler.h>
#include <gfx/video_frame.h>
#include <queues/message_queue.h>
#include <formats/image.h>
#ifdef HAVE_CONFIG_H
@ -42,7 +41,6 @@
#include "../menu/menu_setting.h"
#endif
#include "video_driver.h"
#include "video_thread_wrapper.h"
#include "video_context_driver.h"
@ -58,7 +56,6 @@
#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)
@ -67,14 +64,6 @@
#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;
@ -149,11 +138,8 @@ 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 },
@ -958,7 +944,7 @@ void video_monitor_set_refresh_rate(float hz)
snprintf(msg, sizeof(msg),
"Setting refresh rate to: %.3f Hz.", hz);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
RARCH_LOG("%s\n", msg);
settings->video.refresh_rate = hz;
@ -1554,87 +1540,10 @@ bool video_driver_get_prev_video_out(void)
return true;
}
static void video_driver_msg_queue_init(void)
bool video_driver_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();
initialized = init_video();
if (initialized)
video_driver_msg_queue_init();
return init_video();
}
void video_driver_destroy_data(void)
@ -1645,10 +1554,6 @@ 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;
}
@ -2192,17 +2097,7 @@ void video_driver_frame(const void *data, unsigned width,
video_driver_msg[0] = '\0';
#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)
if (runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &msg) && msg)
strlcpy(video_driver_msg, msg, sizeof(video_driver_msg));
if (!current_video || !current_video->frame(

View File

@ -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);
void video_driver_init(void);
bool video_driver_init(void);
void video_driver_destroy_data(void);
void video_driver_deinit(void);
void video_driver_monitor_reset(void);
@ -544,10 +544,6 @@ 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

View File

@ -56,7 +56,7 @@ static void task_queue_msg_push(unsigned prio, unsigned duration,
bool flush, const char *fmt, ...)
{
#ifdef RARCH_INTERNAL
extern void video_driver_msg_queue_push(const char *msg, unsigned prio,
extern void runloop_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 */
video_driver_msg_queue_push(buf, prio, duration, flush);
runloop_msg_queue_push(buf, prio, duration, flush);
#endif
}

View File

@ -30,8 +30,6 @@
#include "../list_special.h"
#include "../verbosity.h"
#include "../gfx/video_driver.h"
static const location_driver_t *location_drivers[] = {
#ifdef ANDROID
&location_android,
@ -142,7 +140,7 @@ bool driver_location_start(void)
if (settings->location.allow)
return location_driver->start(location_data);
video_driver_msg_queue_push("Location is explicitly disabled.\n", 1, 180, true);
runloop_msg_queue_push("Location is explicitly disabled.\n", 1, 180, true);
}
return false;
}

View File

@ -38,8 +38,6 @@
#include "../core.h"
#include "../verbosity.h"
#include "../gfx/video_driver.h"
struct item_cheat
{
char *desc;
@ -99,9 +97,8 @@ void cheat_manager_apply_cheats(void)
core_set_cheat(&cheat_info);
}
}
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));
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));
#ifdef HAVE_CHEEVOS
data_bool = idx != 0;
@ -348,7 +345,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)
);
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
RARCH_LOG("%s\n", msg);
}

View File

@ -31,7 +31,6 @@
#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. */
@ -589,7 +588,7 @@ void state_manager_check_rewind(bool pressed)
audio_driver_setup_rewind();
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_REWINDING), 0,
runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL)
? 1 : 30, true);
@ -603,7 +602,7 @@ void state_manager_check_rewind(bool pressed)
bsv_movie_ctl(BSV_MOVIE_CTL_FRAME_REWIND, NULL);
}
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_REWIND_REACHED_END),
0, 30, true);
}

View File

@ -40,7 +40,6 @@
#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"
@ -1340,7 +1339,7 @@ static int action_ok_playlist_entry_collection(const char *path,
if (!menu_content_playlist_load(&playlist_info))
{
video_driver_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
return menu_cbs_exit();
}
@ -1427,7 +1426,7 @@ static int action_ok_playlist_entry(const char *path,
if (!menu_content_playlist_load(&playlist_info))
{
video_driver_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
return menu_cbs_exit();
}
@ -1533,7 +1532,7 @@ static int action_ok_playlist_entry_start_content(const char *path,
if (!menu_content_playlist_load(&playlist_info))
{
video_driver_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
return menu_cbs_exit();
}
@ -1692,11 +1691,11 @@ static void menu_input_st_string_cb_save_preset(void *userdata,
ret = menu_shader_manager_save_preset(str, false, false);
if(ret)
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
1, 100, true);
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET),
1, 100, true);
}
@ -1775,11 +1774,11 @@ static int generic_action_ok_shader_preset_save(const char *path,
}
if(menu_shader_manager_save_preset(file, false, true))
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
1, 100, true);
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET),
1, 100, true);
@ -1886,11 +1885,11 @@ static int generic_action_ok_remap_file_save(const char *path,
path_mkdir(directory);
if(input_remapping_save_file(file))
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_REMAP_FILE_SAVED_SUCCESSFULLY),
1, 100, true);
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_ERROR_SAVING_REMAP_FILE),
1, 100, true);
@ -2685,7 +2684,7 @@ static int action_ok_option_create(const char *path,
if (!retroarch_validate_game_options(game_path, sizeof(game_path), true))
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_ERROR_SAVING_CORE_OPTIONS_FILE),
1, 100, true);
return 0;
@ -2702,7 +2701,7 @@ static int action_ok_option_create(const char *path,
if(config_file_write(conf, game_path))
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_CORE_OPTIONS_FILE_CREATED_SUCCESSFULLY),
1, 100, true);
path_set(RARCH_PATH_CORE_OPTIONS, game_path);
@ -3531,7 +3530,7 @@ static int action_ok_video_resolution(const char *path,
snprintf(msg, sizeof(msg),
"Applying: %dx%d\n START to reset",
width, height);
video_driver_msg_queue_push(msg, 1, 100, true);
runloop_msg_queue_push(msg, 1, 100, true);
}
return 0;
@ -3548,7 +3547,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())
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
"Netplay will start when content is loaded.",
1, 480, true);
return 0;
@ -3579,7 +3578,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])
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
"Please specify the Netplay server's IP address or hostname.",
1, 480, true);
return -1;
@ -3588,7 +3587,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())
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
"Netplay will start when content is loaded.",
1, 480, true);
return 0;

View File

@ -37,7 +37,6 @@
#include "../../runloop.h"
#include "../../performance_counters.h"
#include "../../gfx/video_driver.h"
#include "../../gfx/video_shader_driver.h"
#include "../../input/input_remapping.h"
@ -322,7 +321,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));
video_driver_msg_queue_push(msg, 1, 100, true);
runloop_msg_queue_push(msg, 1, 100, true);
}
return 0;

View File

@ -431,7 +431,6 @@ static void xui_frame(void *data)
XuiRenderSetViewTransform( app.GetDC(), &matOrigView );
#if 0
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message);
if (message)
@ -443,7 +442,6 @@ static void xui_frame(void *data)
if (message)
xui_render_message(message);
}
#endif
XuiRenderEnd( app.GetDC() );

View File

@ -44,7 +44,6 @@
#endif
#include "../gfx/video_driver.h"
#include "../frontend/frontend_driver.h"
#include "widgets/menu_input_bind_dialog.h"
@ -1325,10 +1324,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))
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_AUTOCONFIG_FILE_SAVED_SUCCESSFULLY), 1, 100, true);
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_AUTOCONFIG_FILE_ERROR_SAVING), 1, 100, true);
return 0;

16
movie.c
View File

@ -31,8 +31,6 @@
#include "msg_hash.h"
#include "verbosity.h"
#include "gfx/video_driver.h"
#include "command.h"
#include "file_path_special.h"
@ -321,7 +319,7 @@ static void bsv_movie_init_state(void)
}
bsv_movie_state.movie_playback = true;
video_driver_msg_queue_push(msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK),
runloop_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;
@ -337,14 +335,14 @@ static void bsv_movie_init_state(void)
if (!(bsv_movie_init_handle(bsv_movie_state.movie_start_path,
RARCH_MOVIE_RECORD)))
{
video_driver_msg_queue_push(
runloop_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;
}
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_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);
@ -470,7 +468,7 @@ static bool runloop_check_movie_playback(void)
if (!bsv_movie_ctl(BSV_MOVIE_CTL_END, NULL))
return false;
video_driver_msg_queue_push(
runloop_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));
@ -488,7 +486,7 @@ static bool runloop_check_movie_record(void)
if (!bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL))
return false;
video_driver_msg_queue_push(
runloop_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));
@ -529,14 +527,14 @@ static bool runloop_check_movie_init(void)
if (bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL))
{
video_driver_msg_queue_push(msg, 2, 180, true);
runloop_msg_queue_push(msg, 2, 180, true);
RARCH_LOG("%s \"%s\".\n",
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
path);
}
else
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD),
2, 180, true);
RARCH_ERR("%s\n",

View File

@ -26,7 +26,7 @@
#include "../../configuration.h"
#include "../../input/input_driver.h"
#include "../../gfx/video_driver.h"
#include "../../runloop.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;
video_driver_msg_queue_push(success_msg, 1, 180, false);
runloop_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);
video_driver_msg_queue_push(dmsg, 1, 180, false);
runloop_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));
video_driver_msg_queue_push(
runloop_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));
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_NETPLAY_FAILED),
0, 180, false);
return false;

View File

@ -27,7 +27,6 @@
#include "../../configuration.h"
#include "../../content.h"
#include "../../gfx/video_driver.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../version.h"
@ -91,14 +90,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
RARCH_LOG("%s\n", msg);
}
RARCH_LOG("%s %u\n", msg_hash_to_str(MSG_CONNECTION_SLOT),
@ -115,7 +114,7 @@ void netplay_log_connection(const struct sockaddr_storage *their_addr,
snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_GOT_CONNECTION_FROM),
nick);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_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);
@ -412,7 +411,7 @@ error:
if (dmsg)
{
RARCH_ERR("%s\n", dmsg);
video_driver_msg_queue_push(dmsg, 1, 180, false);
runloop_msg_queue_push(dmsg, 1, 180, false);
}
return false;
}
@ -437,7 +436,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
}
/* Unstall if we were waiting for this */
@ -623,7 +622,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
return false;
}
@ -692,7 +691,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
return false;
}
@ -823,7 +822,7 @@ error:
if (dmsg)
{
RARCH_ERR("%s\n", dmsg);
video_driver_msg_queue_push(dmsg, 1, 180, false);
runloop_msg_queue_push(dmsg, 1, 180, false);
}
return false;
}
@ -850,7 +849,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
return false;
}
@ -935,7 +934,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
}
/* Now check the SRAM */

View File

@ -24,7 +24,7 @@
#include "netplay_private.h"
#include "../../gfx/video_driver.h"
#include "../../runloop.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);
video_driver_msg_queue_push(dmsg, 1, 180, false);
runloop_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));
video_driver_msg_queue_push(
runloop_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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
}
else
{
@ -672,7 +672,8 @@ 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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
}
/* Tell the player even if they were confused */
@ -804,7 +805,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
#ifdef DEBUG_NETPLAY_STEPS
RARCH_LOG("Received mode change self->%u\n", player);
@ -824,7 +825,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
#ifdef DEBUG_NETPLAY_STEPS
RARCH_LOG("Received mode change %u self->spectating\n", netplay->self_player);
@ -854,7 +855,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
#ifdef DEBUG_NETPLAY_STEPS
RARCH_LOG("Received mode change spectator->%u\n", player);
@ -870,7 +871,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
#ifdef DEBUG_NETPLAY_STEPS
RARCH_LOG("Received mode change %u->spectator\n", player);
@ -928,7 +929,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
if (dmsg)
{
RARCH_LOG("%s\n", dmsg);
video_driver_msg_queue_push(dmsg, 1, 180, false);
runloop_msg_queue_push(dmsg, 1, 180, false);
}
break;
}
@ -1190,7 +1191,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
break;
}
@ -1342,7 +1343,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);
video_driver_msg_queue_push(msg, 1, 180, false);
runloop_msg_queue_push(msg, 1, 180, false);
RARCH_LOG("%s\n", msg);
#endif
}

View File

@ -35,7 +35,6 @@
#include "../msg_hash.h"
#include "../list_special.h"
#include "../gfx/video_driver.h"
static const record_driver_t *record_drivers[] = {
#ifdef HAVE_FFMPEG
@ -216,7 +215,7 @@ void recording_dump_frame(const void *data, unsigned width,
{
RARCH_WARN("%s\n", msg_hash_to_str(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE));
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE),
1, 180, true);
command_event(CMD_EVENT_RECORD_DEINIT, NULL);

View File

@ -1174,6 +1174,7 @@ 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);
@ -1239,6 +1240,7 @@ 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())

112
runloop.c
View File

@ -23,6 +23,7 @@
#include <compat/strl.h>
#include <retro_assert.h>
#include <file/file_path.h>
#include <queues/message_queue.h>
#include <queues/task_queue.h>
#include <string/stdstring.h>
#include <features/features_cpu.h>
@ -100,11 +101,23 @@ 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;
@ -128,6 +141,47 @@ 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,
@ -450,6 +504,56 @@ 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
@ -891,7 +995,7 @@ static enum runloop_state runloop_check_state(
msg_hash_to_str(MSG_STATE_SLOT),
settings->state_slot);
video_driver_msg_queue_push(msg, 2, 180, true);
runloop_msg_queue_push(msg, 2, 180, true);
RARCH_LOG("%s\n", msg);
}
@ -908,7 +1012,7 @@ static enum runloop_state runloop_check_state(
msg_hash_to_str(MSG_STATE_SLOT),
settings->state_slot);
video_driver_msg_queue_push(msg, 2, 180, true);
runloop_msg_queue_push(msg, 2, 180, true);
RARCH_LOG("%s\n", msg);
}
@ -935,10 +1039,10 @@ static enum runloop_state runloop_check_state(
}
if (state_manager_frame_is_reversed())
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_SLOW_MOTION_REWIND), 2, 30, true);
else
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_SLOW_MOTION), 2, 30, true);
}

View File

@ -91,6 +91,11 @@ 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,
@ -196,6 +201,9 @@ 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

View File

@ -76,7 +76,6 @@
#include "../configuration.h"
#include "../defaults.h"
#include "../frontend/frontend.h"
#include "../gfx/video_driver.h"
#include "../playlist.h"
#include "../paths.h"
#include "../retroarch.h"
@ -1272,7 +1271,7 @@ error:
if (error_string)
{
video_driver_msg_queue_push(error_string, 2, 90, true);
runloop_msg_queue_push(error_string, 2, 90, true);
free(error_string);
}
@ -1300,7 +1299,7 @@ error:
return false;
skip:
video_driver_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 100, 500, true);
runloop_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;
@ -1442,7 +1441,7 @@ end:
{
RARCH_ERR("%s\n", error_string);
}
video_driver_msg_queue_push(error_string, 2, ret ? 1 : 180, true);
runloop_msg_queue_push(error_string, 2, ret ? 1 : 180, true);
free(error_string);
}

View File

@ -28,7 +28,6 @@
#include "tasks_internal.h"
#include "../database_info.h"
#include "../gfx/video_driver.h"
#include "../configuration.h"
#include "../file_path_special.h"
@ -112,7 +111,7 @@ static int task_database_iterate_start(database_info_handle_t *db,
name);
if (!string_is_empty(msg))
video_driver_msg_queue_push(msg, 1, 180, true);
runloop_msg_queue_push(msg, 1, 180, true);
#if 0
RARCH_LOG("msg: %s\n", msg);
@ -657,7 +656,7 @@ static void task_database_handler(retro_task_t *task)
}
else
{
video_driver_msg_queue_push(
runloop_msg_queue_push(
msg_hash_to_str(MSG_SCANNING_OF_DIRECTORY_FINISHED),
0, 180, true);
goto task_finished;

View File

@ -48,7 +48,6 @@
#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"
@ -968,7 +967,7 @@ error:
load_data->path);
if (!load_data->mute)
video_driver_msg_queue_push(err_buf, 1, 180, true);
runloop_msg_queue_push(err_buf, 1, 180, true);
RARCH_ERR("%s \"%s\".\n",
msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE),

View File

@ -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));
video_driver_msg_queue_push(msg, 1, is_paused ? 1 : 180, true);
runloop_msg_queue_push(msg, 1, is_paused ? 1 : 180, true);
free(msg);
}
}

View File

@ -19,8 +19,6 @@
#include <retro_miscellaneous.h>
#include "../wifi_driver.h"
#include "../../gfx/video_driver.h"
#include "../../runloop.h"
#include "../../lakka.h"
@ -64,7 +62,7 @@ static void connmanctl_scan(void)
pclose(popen("connmanctl scan wifi", "r"));
video_driver_msg_queue_push("Wi-Fi scan complete.", 1, 180, true);
runloop_msg_queue_push("Wi-Fi scan complete.", 1, 180, true);
serv_file = popen("connmanctl services", "r");
while (fgets (line, 512, serv_file) != NULL)
@ -215,8 +213,9 @@ static bool connmanctl_connect_ssid(unsigned i, const char* passphrase)
command_file = popen(command, "r");
while (fgets (ln, 512, command_file) != NULL)
video_driver_msg_queue_push(ln, 1, 180, true);
{
runloop_msg_queue_push(ln, 1, 180, true);
}
pclose(command_file);
return true;