Create video_driver_frame wrapper function

This commit is contained in:
twinaphex 2015-03-24 13:27:38 +01:00
parent eb1dda367c
commit 4f6a3532f6
3 changed files with 21 additions and 8 deletions

View File

@ -798,3 +798,19 @@ void video_driver_get_video_output_prev(void)
&& driver->video_poke->get_video_output_prev) && driver->video_poke->get_video_output_prev)
driver->video_poke->get_video_output_prev(driver->video_data); driver->video_poke->get_video_output_prev(driver->video_data);
} }
bool video_driver_frame(const void *frame, unsigned width,
unsigned height, unsigned pitch, const char *msg)
{
bool ret;
driver_t *driver = driver_get_ptr();
runloop_t *runloop = rarch_main_get_ptr();
if (driver && driver->video
&& driver->video->frame(driver->video_data,
frame, width, height, pitch, msg))
{
runloop->frames.video.count++;
return true;
}
return false;
}

View File

@ -320,6 +320,9 @@ void video_driver_get_video_output_next(void);
void video_driver_get_video_output_prev(void); void video_driver_get_video_output_prev(void);
bool video_driver_frame(const void *frame, unsigned width,
unsigned height, unsigned pitch, const char *msg);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -119,7 +119,6 @@ static void video_frame(const void *data, unsigned width,
{ {
unsigned output_width = 0, output_height = 0, output_pitch = 0; unsigned output_width = 0, output_height = 0, output_pitch = 0;
const char *msg = NULL; const char *msg = NULL;
runloop_t *runloop = rarch_main_get_ptr();
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -160,13 +159,8 @@ static void video_frame(const void *data, unsigned width,
pitch = output_pitch; pitch = output_pitch;
} }
if (driver->video->frame(driver->video_data, data, width, height, pitch, msg)) if (!video_driver_frame(data, width, height, pitch, msg))
{ driver->video_active = false;
runloop->frames.video.count++;
return;
}
driver->video_active = false;
} }
/** /**