Rename rarch_render_cached_frame to video_driver_cached_frame

This commit is contained in:
twinaphex 2015-05-20 21:06:44 +02:00
parent 18e261abcd
commit cf2c0f6930
11 changed files with 52 additions and 51 deletions

View File

@ -1362,7 +1362,7 @@ bool event_command(enum event_command cmd)
event_command(EVENT_CMD_AUDIO_STOP);
if (settings->video.black_frame_insertion)
rarch_render_cached_frame();
video_driver_cached_frame();
}
else
{

View File

@ -2784,7 +2784,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
goto error;
}
rarch_render_cached_frame();
video_driver_cached_frame();
dst = buffer;
src = (const uint8_t*)gl->readback_buffer_screenshot;

View File

@ -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)
{
SDL_Surface *surf = NULL, *bgr24 = NULL;
sdl2_video_t *vid = (sdl2_video_t*)data;
RARCH_PERFORMANCE_INIT(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);
SDL_Surface *bgr24 = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_BGR24, 0);
surf = SDL_GetWindowSurface(vid->window);
bgr24 = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_BGR24, 0);
if (!bgr24)
{

View File

@ -865,6 +865,39 @@ bool video_driver_frame(const void *frame, unsigned width,
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)
{
if (width)

View File

@ -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);
/**
* video_driver_cached_frame:
*
* Renders the current video frame.
**/
void video_driver_cached_frame(void);
#ifdef __cplusplus
}
#endif

View File

@ -143,7 +143,7 @@ static void thread_loop(void *data)
/* We can read safely
*
* 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.
*
* This means frame() callback in threaded wrapper will

View File

@ -75,7 +75,7 @@ void menu_display_fb(void)
}
}
rarch_render_cached_frame();
video_driver_cached_frame();
}
bool menu_display_update_pending(void)

View File

@ -53,39 +53,6 @@
#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"
#define _PSUPP(var, name, desc) printf("\t%s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no")

View File

@ -93,13 +93,6 @@ void rarch_main_init_wrap(const struct rarch_main_wrap *args,
**/
void rarch_main_deinit(void);
/**
* rarch_render_cached_frame:
*
* Renders the current video frame.
**/
void rarch_render_cached_frame(void);
/**
* rarch_replace_config:
* @path : Path to config file to replace

View File

@ -231,7 +231,7 @@ static void check_slowmotion(bool slowmotion_pressed)
return;
if (settings->video.black_frame_insertion)
rarch_render_cached_frame();
video_driver_cached_frame();
rarch_main_msg_queue_push(global->rewind.frame_is_reverse ?
"Slow motion rewind." : "Slow motion.", 0, 30, true);
@ -471,7 +471,7 @@ static int do_pause_state_checks(
if (fullscreen_toggle_pressed)
{
event_command(EVENT_CMD_FULLSCREEN_TOGGLE);
rarch_render_cached_frame();
video_driver_cached_frame();
}
if (!check_is_oneshot)

View File

@ -278,7 +278,7 @@ bool take_screenshot(void)
video_driver_set_texture_enable(false, false);
if (driver->video)
rarch_render_cached_frame();
video_driver_cached_frame();
}
if (viewport_read)
@ -333,7 +333,7 @@ bool take_screenshot(void)
rarch_main_msg_queue_push(msg, 1, runloop->is_paused ? 1 : 180, true);
if (runloop->is_paused)
rarch_render_cached_frame();
video_driver_cached_frame();
return ret;
}