Skip to content

Commit

Permalink
Rename runloop_msg_queue_push to video_driver_msg_queue_push
Browse files Browse the repository at this point in the history
and move code to video_driver.c
  • Loading branch information
inactive123 committed Dec 22, 2016
1 parent 9f09dd0 commit ad73869
Show file tree
Hide file tree
Showing 50 changed files with 305 additions and 261 deletions.
4 changes: 3 additions & 1 deletion camera/camera_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 8 additions & 7 deletions cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -2687,7 +2688,7 @@ bool cheevos_load(const void *data)
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;
}
Expand Down Expand Up @@ -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
Expand Down
41 changes: 21 additions & 20 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -2226,15 +2227,15 @@ 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");
#endif
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");
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
}

Expand Down
7 changes: 4 additions & 3 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down
4 changes: 3 additions & 1 deletion dirs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include "runloop.h"
#include "verbosity.h"

#include "gfx/video_driver.h"

struct rarch_dir_list
{
struct string_list *list;
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions dynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion gfx/common/x11_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions gfx/drivers/exynos_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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 *
Expand Down
Loading

0 comments on commit ad73869

Please sign in to comment.