mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(record_ffmpeg.c) Move scaler code to gfx/video_frame.h
This commit is contained in:
parent
bfcc89f580
commit
b8e140d6c4
@ -64,6 +64,40 @@ static INLINE void video_frame_scale(
|
|||||||
scaler_ctx_scale(scaler, output, input);
|
scaler_ctx_scale(scaler, output, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static INLINE void video_frame_record_scale(
|
||||||
|
struct scaler_ctx *scaler,
|
||||||
|
void *output,
|
||||||
|
const void *input,
|
||||||
|
unsigned scaler_width,
|
||||||
|
unsigned scaler_height,
|
||||||
|
unsigned scaler_pitch,
|
||||||
|
unsigned width,
|
||||||
|
unsigned height,
|
||||||
|
unsigned pitch,
|
||||||
|
bool bilinear)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
width != (unsigned)scaler->in_width
|
||||||
|
|| height != (unsigned)scaler->in_height
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scaler->in_width = width;
|
||||||
|
scaler->in_height = height;
|
||||||
|
scaler->in_stride = pitch;
|
||||||
|
|
||||||
|
scaler->scaler_type = bilinear ?
|
||||||
|
SCALER_TYPE_BILINEAR : SCALER_TYPE_POINT;
|
||||||
|
|
||||||
|
scaler->out_width = scaler_width;
|
||||||
|
scaler->out_height = scaler_height;
|
||||||
|
scaler->out_stride = scaler_pitch;
|
||||||
|
|
||||||
|
scaler_ctx_gen_filter(scaler);
|
||||||
|
}
|
||||||
|
|
||||||
|
scaler_ctx_scale(scaler, output, input);
|
||||||
|
}
|
||||||
|
|
||||||
static INLINE void video_frame_convert_argb8888_to_abgr8888(
|
static INLINE void video_frame_convert_argb8888_to_abgr8888(
|
||||||
struct scaler_ctx *scaler,
|
struct scaler_ctx *scaler,
|
||||||
void *output, const void *input,
|
void *output, const void *input,
|
||||||
|
@ -66,6 +66,8 @@ extern "C" {
|
|||||||
#include "../../audio/audio_utils.h"
|
#include "../../audio/audio_utils.h"
|
||||||
#include "../record_driver.h"
|
#include "../record_driver.h"
|
||||||
|
|
||||||
|
#include "../../gfx/video_frame.h"
|
||||||
|
|
||||||
#ifndef PIX_FMT_RGB32
|
#ifndef PIX_FMT_RGB32
|
||||||
#define PIX_FMT_RGB32 AV_PIX_FMT_RGB32
|
#define PIX_FMT_RGB32 AV_PIX_FMT_RGB32
|
||||||
#endif
|
#endif
|
||||||
@ -978,26 +980,17 @@ static void ffmpeg_scale_input(ffmpeg_t *handle,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((int)vid->width != handle->video.scaler.in_width
|
video_frame_record_scale(
|
||||||
|| (int)vid->height != handle->video.scaler.in_height)
|
&handle->video.scaler,
|
||||||
{
|
handle->video.conv_frame->data[0],
|
||||||
handle->video.scaler.in_width = vid->width;
|
vid->data,
|
||||||
handle->video.scaler.in_height = vid->height;
|
handle->params.out_width,
|
||||||
handle->video.scaler.in_stride = vid->pitch;
|
handle->params.out_height,
|
||||||
|
handle->video.conv_frame->linesize[0],
|
||||||
handle->video.scaler.scaler_type = shrunk ?
|
vid->width,
|
||||||
SCALER_TYPE_BILINEAR : SCALER_TYPE_POINT;
|
vid->height,
|
||||||
|
vid->pitch,
|
||||||
handle->video.scaler.out_width = handle->params.out_width;
|
shrunk);
|
||||||
handle->video.scaler.out_height = handle->params.out_height;
|
|
||||||
handle->video.scaler.out_stride =
|
|
||||||
handle->video.conv_frame->linesize[0];
|
|
||||||
|
|
||||||
scaler_ctx_gen_filter(&handle->video.scaler);
|
|
||||||
}
|
|
||||||
|
|
||||||
scaler_ctx_scale(&handle->video.scaler,
|
|
||||||
handle->video.conv_frame->data[0], vid->data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user