mirror of
https://github.com/libretro/RetroArch
synced 2025-03-21 13:20:52 +00:00
Rename rarch_render_cached_frame to video_driver_cached_frame
This commit is contained in:
parent
18e261abcd
commit
cf2c0f6930
@ -1362,7 +1362,7 @@ bool event_command(enum event_command cmd)
|
|||||||
event_command(EVENT_CMD_AUDIO_STOP);
|
event_command(EVENT_CMD_AUDIO_STOP);
|
||||||
|
|
||||||
if (settings->video.black_frame_insertion)
|
if (settings->video.black_frame_insertion)
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2784,7 +2784,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
|
|
||||||
dst = buffer;
|
dst = buffer;
|
||||||
src = (const uint8_t*)gl->readback_buffer_screenshot;
|
src = (const uint8_t*)gl->readback_buffer_screenshot;
|
||||||
|
@ -605,15 +605,16 @@ static void sdl2_gfx_viewport_info(void *data, struct video_viewport *vp)
|
|||||||
|
|
||||||
static bool sdl2_gfx_read_viewport(void *data, uint8_t *buffer)
|
static bool sdl2_gfx_read_viewport(void *data, uint8_t *buffer)
|
||||||
{
|
{
|
||||||
|
SDL_Surface *surf = NULL, *bgr24 = NULL;
|
||||||
sdl2_video_t *vid = (sdl2_video_t*)data;
|
sdl2_video_t *vid = (sdl2_video_t*)data;
|
||||||
|
|
||||||
RARCH_PERFORMANCE_INIT(sdl2_gfx_read_viewport);
|
RARCH_PERFORMANCE_INIT(sdl2_gfx_read_viewport);
|
||||||
RARCH_PERFORMANCE_START(sdl2_gfx_read_viewport);
|
RARCH_PERFORMANCE_START(sdl2_gfx_read_viewport);
|
||||||
|
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
|
|
||||||
SDL_Surface *surf = SDL_GetWindowSurface(vid->window);
|
surf = SDL_GetWindowSurface(vid->window);
|
||||||
SDL_Surface *bgr24 = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_BGR24, 0);
|
bgr24 = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_BGR24, 0);
|
||||||
|
|
||||||
if (!bgr24)
|
if (!bgr24)
|
||||||
{
|
{
|
||||||
|
@ -865,6 +865,39 @@ bool video_driver_frame(const void *frame, unsigned width,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* video_driver_cached_frame:
|
||||||
|
*
|
||||||
|
* Renders the current video frame.
|
||||||
|
**/
|
||||||
|
void video_driver_cached_frame(void)
|
||||||
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
runloop_t *runloop = rarch_main_get_ptr();
|
||||||
|
void *recording = driver ? driver->recording_data : NULL;
|
||||||
|
|
||||||
|
if (runloop->is_idle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Cannot allow recording when pushing duped frames. */
|
||||||
|
driver->recording_data = NULL;
|
||||||
|
|
||||||
|
/* Not 100% safe, since the library might have
|
||||||
|
* freed the memory, but no known implementations do this.
|
||||||
|
* It would be really stupid at any rate ...
|
||||||
|
*/
|
||||||
|
if (driver->retro_ctx.frame_cb)
|
||||||
|
driver->retro_ctx.frame_cb(
|
||||||
|
(global->frame_cache.data == RETRO_HW_FRAME_BUFFER_VALID)
|
||||||
|
? NULL : global->frame_cache.data,
|
||||||
|
global->frame_cache.width,
|
||||||
|
global->frame_cache.height,
|
||||||
|
global->frame_cache.pitch);
|
||||||
|
|
||||||
|
driver->recording_data = recording;
|
||||||
|
}
|
||||||
|
|
||||||
void video_driver_get_size(unsigned *width, unsigned *height)
|
void video_driver_get_size(unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
if (width)
|
if (width)
|
||||||
|
@ -374,6 +374,13 @@ enum retro_pixel_format video_driver_get_pixel_format(void);
|
|||||||
|
|
||||||
void video_driver_set_pixel_format(enum retro_pixel_format fmt);
|
void video_driver_set_pixel_format(enum retro_pixel_format fmt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* video_driver_cached_frame:
|
||||||
|
*
|
||||||
|
* Renders the current video frame.
|
||||||
|
**/
|
||||||
|
void video_driver_cached_frame(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -143,7 +143,7 @@ static void thread_loop(void *data)
|
|||||||
/* We can read safely
|
/* We can read safely
|
||||||
*
|
*
|
||||||
* read_viewport() in GL driver calls
|
* read_viewport() in GL driver calls
|
||||||
* rarch_render_cached_frame() to be able to read from
|
* video_driver_cached_frame() to be able to read from
|
||||||
* back buffer.
|
* back buffer.
|
||||||
*
|
*
|
||||||
* This means frame() callback in threaded wrapper will
|
* This means frame() callback in threaded wrapper will
|
||||||
|
@ -75,7 +75,7 @@ void menu_display_fb(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menu_display_update_pending(void)
|
bool menu_display_update_pending(void)
|
||||||
|
33
retroarch.c
33
retroarch.c
@ -53,39 +53,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* rarch_render_cached_frame:
|
|
||||||
*
|
|
||||||
* Renders the current video frame.
|
|
||||||
**/
|
|
||||||
void rarch_render_cached_frame(void)
|
|
||||||
{
|
|
||||||
driver_t *driver = driver_get_ptr();
|
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
|
||||||
void *recording = driver ? driver->recording_data : NULL;
|
|
||||||
|
|
||||||
if (runloop->is_idle)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Cannot allow recording when pushing duped frames. */
|
|
||||||
driver->recording_data = NULL;
|
|
||||||
|
|
||||||
/* Not 100% safe, since the library might have
|
|
||||||
* freed the memory, but no known implementations do this.
|
|
||||||
* It would be really stupid at any rate ...
|
|
||||||
*/
|
|
||||||
if (driver->retro_ctx.frame_cb)
|
|
||||||
driver->retro_ctx.frame_cb(
|
|
||||||
(global->frame_cache.data == RETRO_HW_FRAME_BUFFER_VALID)
|
|
||||||
? NULL : global->frame_cache.data,
|
|
||||||
global->frame_cache.width,
|
|
||||||
global->frame_cache.height,
|
|
||||||
global->frame_cache.pitch);
|
|
||||||
|
|
||||||
driver->recording_data = recording;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "config.features.h"
|
#include "config.features.h"
|
||||||
|
|
||||||
#define _PSUPP(var, name, desc) printf("\t%s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no")
|
#define _PSUPP(var, name, desc) printf("\t%s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no")
|
||||||
|
@ -93,13 +93,6 @@ void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
|||||||
**/
|
**/
|
||||||
void rarch_main_deinit(void);
|
void rarch_main_deinit(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* rarch_render_cached_frame:
|
|
||||||
*
|
|
||||||
* Renders the current video frame.
|
|
||||||
**/
|
|
||||||
void rarch_render_cached_frame(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rarch_replace_config:
|
* rarch_replace_config:
|
||||||
* @path : Path to config file to replace
|
* @path : Path to config file to replace
|
||||||
|
@ -231,7 +231,7 @@ static void check_slowmotion(bool slowmotion_pressed)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (settings->video.black_frame_insertion)
|
if (settings->video.black_frame_insertion)
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
|
|
||||||
rarch_main_msg_queue_push(global->rewind.frame_is_reverse ?
|
rarch_main_msg_queue_push(global->rewind.frame_is_reverse ?
|
||||||
"Slow motion rewind." : "Slow motion.", 0, 30, true);
|
"Slow motion rewind." : "Slow motion.", 0, 30, true);
|
||||||
@ -471,7 +471,7 @@ static int do_pause_state_checks(
|
|||||||
if (fullscreen_toggle_pressed)
|
if (fullscreen_toggle_pressed)
|
||||||
{
|
{
|
||||||
event_command(EVENT_CMD_FULLSCREEN_TOGGLE);
|
event_command(EVENT_CMD_FULLSCREEN_TOGGLE);
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check_is_oneshot)
|
if (!check_is_oneshot)
|
||||||
|
@ -278,7 +278,7 @@ bool take_screenshot(void)
|
|||||||
video_driver_set_texture_enable(false, false);
|
video_driver_set_texture_enable(false, false);
|
||||||
|
|
||||||
if (driver->video)
|
if (driver->video)
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewport_read)
|
if (viewport_read)
|
||||||
@ -333,7 +333,7 @@ bool take_screenshot(void)
|
|||||||
rarch_main_msg_queue_push(msg, 1, runloop->is_paused ? 1 : 180, true);
|
rarch_main_msg_queue_push(msg, 1, runloop->is_paused ? 1 : 180, true);
|
||||||
|
|
||||||
if (runloop->is_paused)
|
if (runloop->is_paused)
|
||||||
rarch_render_cached_frame();
|
video_driver_cached_frame();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user