mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 13:20:43 +00:00
Fix video_frame_filter
This commit is contained in:
parent
be5f3254ba
commit
04fe4c4f85
@ -65,35 +65,35 @@ static void video_frame_scale(const void *data,
|
|||||||
RARCH_PERFORMANCE_STOP(video_frame_conv);
|
RARCH_PERFORMANCE_STOP(video_frame_conv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void video_frame_filter(const void *data,
|
static bool video_frame_filter(const void *data,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
size_t pitch)
|
size_t pitch,
|
||||||
|
unsigned *output_width, unsigned *output_height,
|
||||||
|
unsigned *output_pitch)
|
||||||
{
|
{
|
||||||
RARCH_PERFORMANCE_INIT(softfilter_process);
|
RARCH_PERFORMANCE_INIT(softfilter_process);
|
||||||
unsigned owidth = 0, oheight = 0, opitch = 0;
|
|
||||||
|
|
||||||
|
if (!g_extern.filter.filter)
|
||||||
|
return false;
|
||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
rarch_softfilter_get_output_size(g_extern.filter.filter,
|
rarch_softfilter_get_output_size(g_extern.filter.filter,
|
||||||
&owidth, &oheight, width, height);
|
output_width, output_height, width, height);
|
||||||
|
|
||||||
opitch = owidth * g_extern.filter.out_bpp;
|
*output_pitch = (*output_width) * g_extern.filter.out_bpp;
|
||||||
|
|
||||||
RARCH_PERFORMANCE_START(softfilter_process);
|
RARCH_PERFORMANCE_START(softfilter_process);
|
||||||
rarch_softfilter_process(g_extern.filter.filter,
|
rarch_softfilter_process(g_extern.filter.filter,
|
||||||
g_extern.filter.buffer, opitch,
|
g_extern.filter.buffer, *output_pitch,
|
||||||
data, width, height, pitch);
|
data, width, height, pitch);
|
||||||
RARCH_PERFORMANCE_STOP(softfilter_process);
|
RARCH_PERFORMANCE_STOP(softfilter_process);
|
||||||
|
|
||||||
if (g_settings.video.post_filter_record)
|
if (g_settings.video.post_filter_record)
|
||||||
recording_dump_frame(g_extern.filter.buffer,
|
recording_dump_frame(g_extern.filter.buffer,
|
||||||
owidth, oheight, opitch);
|
*output_width, *output_height, *output_pitch);
|
||||||
|
|
||||||
data = g_extern.filter.buffer;
|
return true;
|
||||||
width = owidth;
|
|
||||||
height = oheight;
|
|
||||||
pitch = opitch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,6 +108,7 @@ static void video_frame_filter(const void *data,
|
|||||||
static void video_frame(const void *data, unsigned width,
|
static void video_frame(const void *data, unsigned width,
|
||||||
unsigned height, size_t pitch)
|
unsigned height, size_t pitch)
|
||||||
{
|
{
|
||||||
|
unsigned output_width = 0, output_height = 0, output_pitch = 0;
|
||||||
const char *msg = NULL;
|
const char *msg = NULL;
|
||||||
|
|
||||||
if (!driver.video_active)
|
if (!driver.video_active)
|
||||||
@ -134,8 +135,14 @@ static void video_frame(const void *data, unsigned width,
|
|||||||
msg = msg_queue_pull(g_extern.msg_queue);
|
msg = msg_queue_pull(g_extern.msg_queue);
|
||||||
driver.current_msg = msg;
|
driver.current_msg = msg;
|
||||||
|
|
||||||
if (g_extern.filter.filter)
|
if (video_frame_filter(data, width, height, pitch,
|
||||||
video_frame_filter(data, width, height, pitch);
|
&output_width, &output_height, &output_pitch))
|
||||||
|
{
|
||||||
|
data = g_extern.filter.buffer;
|
||||||
|
width = output_width;
|
||||||
|
height = output_height;
|
||||||
|
pitch = output_pitch;
|
||||||
|
}
|
||||||
|
|
||||||
if (!driver.video->frame(driver.video_data, data, width, height, pitch, msg))
|
if (!driver.video->frame(driver.video_data, data, width, height, pitch, msg))
|
||||||
driver.video_active = false;
|
driver.video_active = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user