1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-09 08:27:18 +00:00

vo_opengl: add FBOTEX_FUZZY alias

Minor reusability factor
This commit is contained in:
Niklas Haas 2015-03-25 23:06:46 +01:00 committed by wm4
parent 6e1c950069
commit a60e725113
2 changed files with 5 additions and 6 deletions

View File

@ -84,6 +84,7 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h,
GLenum iformat, int flags); GLenum iformat, int flags);
#define FBOTEX_FUZZY_W 1 #define FBOTEX_FUZZY_W 1
#define FBOTEX_FUZZY_H 2 #define FBOTEX_FUZZY_H 2
#define FBOTEX_FUZZY (FBOTEX_FUZZY_W | FBOTEX_FUZZY_H)
void fbotex_set_filter(struct fbotex *fbo, GLenum gl_filter); void fbotex_set_filter(struct fbotex *fbo, GLenum gl_filter);
// A 3x2 matrix, with the translation part separate. // A 3x2 matrix, with the translation part separate.

View File

@ -1769,8 +1769,7 @@ static void pass_render_frame(struct gl_video *p)
get_scale_factors(p, scale); get_scale_factors(p, scale);
rect.ml *= scale[0]; rect.mr *= scale[0]; rect.ml *= scale[0]; rect.mr *= scale[0];
rect.mt *= scale[1]; rect.mb *= scale[1]; rect.mt *= scale[1]; rect.mb *= scale[1];
finish_pass_fbo(p, &p->blend_subs_fbo, vp_w, vp_h, 0, finish_pass_fbo(p, &p->blend_subs_fbo, vp_w, vp_h, 0, FBOTEX_FUZZY);
FBOTEX_FUZZY_W | FBOTEX_FUZZY_H);
double vpts = p->image.mpi->pts; double vpts = p->image.mpi->pts;
if (vpts == MP_NOPTS_VALUE) if (vpts == MP_NOPTS_VALUE)
vpts = p->osd_pts; vpts = p->osd_pts;
@ -1794,15 +1793,14 @@ static void gl_video_interpolate_frame(struct gl_video *p, int fbo,
struct frame_timing *t) struct frame_timing *t)
{ {
int vp_w = p->dst_rect.x1 - p->dst_rect.x0, int vp_w = p->dst_rect.x1 - p->dst_rect.x0,
vp_h = p->dst_rect.y1 - p->dst_rect.y0, vp_h = p->dst_rect.y1 - p->dst_rect.y0;
fuzz = FBOTEX_FUZZY_W | FBOTEX_FUZZY_H;
// First of all, figure out if we have a frame availble at all, and draw // First of all, figure out if we have a frame availble at all, and draw
// it manually + reset the queue if not // it manually + reset the queue if not
if (!p->surfaces[p->surface_now].pts) { if (!p->surfaces[p->surface_now].pts) {
pass_render_frame(p); pass_render_frame(p);
finish_pass_fbo(p, &p->surfaces[p->surface_now].fbotex, finish_pass_fbo(p, &p->surfaces[p->surface_now].fbotex,
vp_w, vp_h, 0, fuzz); vp_w, vp_h, 0, FBOTEX_FUZZY);
p->surfaces[p->surface_now].pts = t ? t->pts : 0; p->surfaces[p->surface_now].pts = t ? t->pts : 0;
p->surfaces[p->surface_now].vpts = p->image.mpi->pts; p->surfaces[p->surface_now].vpts = p->image.mpi->pts;
p->surface_idx = p->surface_now; p->surface_idx = p->surface_now;
@ -1838,7 +1836,7 @@ static void gl_video_interpolate_frame(struct gl_video *p, int fbo,
MP_STATS(p, "new-pts"); MP_STATS(p, "new-pts");
pass_render_frame(p); pass_render_frame(p);
finish_pass_fbo(p, &p->surfaces[surface_dst].fbotex, finish_pass_fbo(p, &p->surfaces[surface_dst].fbotex,
vp_w, vp_h, 0, fuzz); vp_w, vp_h, 0, FBOTEX_FUZZY);
p->surfaces[surface_dst].pts = t->pts; p->surfaces[surface_dst].pts = t->pts;
p->surfaces[surface_dst].vpts = p->image.mpi->pts; p->surfaces[surface_dst].vpts = p->image.mpi->pts;
p->surface_idx = surface_dst; p->surface_idx = surface_dst;