diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 26e8d228d0..da63f2c29d 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -1759,3 +1759,25 @@ bool video_pixel_frame_scale(const void *data, return true; } + +void video_driver_frame(const void *data, + unsigned width, unsigned height, + size_t pitch, const char *msg) +{ + uint64_t *frame_count = NULL; + driver_t *driver = driver_get_ptr(); + + *driver->current_msg = 0; + + if (msg) + strlcpy(driver->current_msg, msg, sizeof(driver->current_msg)); + + video_driver_ctl(RARCH_DISPLAY_CTL_GET_FRAME_COUNT, &frame_count); + + if (!driver->current_video->frame( + driver->video_data, data, width, height, *frame_count, + pitch, driver->current_msg)) + driver->video_active = false; + + *frame_count = *frame_count + 1; +} diff --git a/gfx/video_driver.h b/gfx/video_driver.h index f0c7ef0efc..f3846cf76c 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -443,6 +443,10 @@ void video_driver_cached_frame_get(const void **data, unsigned *width, void video_driver_menu_settings(void **list_data, void *list_info_data, void *group_data, void *subgroup_data, const char *parent_group); +void video_driver_frame(const void *data, + unsigned width, unsigned height, + size_t pitch, const char *msg); + /** * video_viewport_get_scaled_integer: * @vp : Viewport handle diff --git a/libretro_version_1.c b/libretro_version_1.c index 8ebb44c41c..f51ce09a23 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -51,7 +51,6 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_t pitch) { - uint64_t *frame_count = NULL; unsigned output_width = 0; unsigned output_height = 0; unsigned output_pitch = 0; @@ -59,8 +58,6 @@ static void video_frame(const void *data, unsigned width, driver_t *driver = driver_get_ptr(); global_t *global = global_get_ptr(); settings_t *settings = config_get_ptr(); - const video_driver_t *video = - driver ? (const video_driver_t*)driver->current_video : NULL; if (!driver->video_active) return; @@ -85,13 +82,6 @@ static void video_frame(const void *data, unsigned width, ) recording_dump_frame(data, width, height, pitch); - msg = rarch_main_msg_queue_pull(); - - *driver->current_msg = 0; - - if (msg) - strlcpy(driver->current_msg, msg, sizeof(driver->current_msg)); - if (video_driver_frame_filter(data, width, height, pitch, &output_width, &output_height, &output_pitch)) { @@ -101,13 +91,9 @@ static void video_frame(const void *data, unsigned width, pitch = output_pitch; } - video_driver_ctl(RARCH_DISPLAY_CTL_GET_FRAME_COUNT, &frame_count); + msg = rarch_main_msg_queue_pull(); - if (!video->frame(driver->video_data, data, width, height, *frame_count, - pitch, driver->current_msg)) - driver->video_active = false; - - *frame_count = *frame_count + 1; + video_driver_frame(data, width, height, pitch, msg); } /**