vo_rpi: fix operation

Commit 697c4389a9 worked "almost". I couldn't test it at the time.
This commit is contained in:
wm4 2017-08-15 19:12:39 +02:00
parent 935df644af
commit 34ab0386cb
4 changed files with 17 additions and 5 deletions

View File

@ -314,8 +314,6 @@ void mpgl_osd_draw_finish(struct mpgl_osd *ctx, int index,
gl_sc_blend(sc, factors[0], factors[1], factors[2], factors[3]);
gl_sc_dispatch_draw(sc, target.tex, part->vertices, part->num_vertices);
ctx->change_flag = false;
}
static void set_res(struct mpgl_osd *ctx, struct mp_osd_res res, int stereo_mode)
@ -359,6 +357,7 @@ void mpgl_osd_resize(struct mpgl_osd *ctx, struct mp_osd_res res, int stereo_mod
bool mpgl_osd_check_change(struct mpgl_osd *ctx, struct mp_osd_res *res,
double pts)
{
ctx->change_flag = false;
mpgl_osd_generate(ctx, *res, pts, 0, 0);
return ctx->change_flag;
}

View File

@ -3129,6 +3129,11 @@ void gl_video_set_clear_color(struct gl_video *p, struct m_color c)
p->clear_color = c;
}
void gl_video_set_osd_pts(struct gl_video *p, double pts)
{
p->osd_pts = pts;
}
bool gl_video_check_osd_change(struct gl_video *p, struct mp_osd_res *res,
double pts)
{

View File

@ -169,6 +169,7 @@ struct mp_csp_equalizer;
struct mp_csp_equalizer *gl_video_eq_ptr(struct gl_video *p);
void gl_video_eq_update(struct gl_video *p);
void gl_video_set_clear_color(struct gl_video *p, struct m_color color);
void gl_video_set_osd_pts(struct gl_video *p, double pts);
bool gl_video_check_osd_change(struct gl_video *p, struct mp_osd_res *osd,
double pts);

View File

@ -260,13 +260,12 @@ static void update_osd(struct vo *vo)
MP_STATS(vo, "start rpi_osd");
struct vo_frame frame = {
.pts = p->osd_pts,
};
struct vo_frame frame = {0};
struct fbodst target = {
.tex = ra_create_wrapped_fb(p->egl.ra, 0, p->osd_res.w, p->osd_res.h),
.flip = true,
};
gl_video_set_osd_pts(p->gl_video, p->osd_pts);
gl_video_render_frame(p->gl_video, &frame, target);
ra_tex_free(p->egl.ra, &target.tex);
@ -317,6 +316,9 @@ static void resize(struct vo *vo)
if (mmal_port_parameter_set(input, &dr.hdr))
MP_WARN(vo, "could not set video rectangle\n");
if (p->gl_video)
gl_video_resize(p->gl_video, &src, &dst, &p->osd_res);
}
static void destroy_overlays(struct vo *vo)
@ -411,6 +413,7 @@ static int create_overlays(struct vo *vo)
return -1;
}
p->gl_video = gl_video_init(p->egl.ra, vo->log, vo->global);
gl_video_set_clear_color(p->gl_video, (struct m_color){.a = 0});
gl_video_set_osd_source(p->gl_video, vo->osd);
}
@ -432,6 +435,8 @@ static int create_overlays(struct vo *vo)
}
}
resize(vo);
vo_event(vo, VO_EVENT_WIN_STATE);
vc_dispmanx_update_submit_sync(p->update);
@ -676,6 +681,8 @@ static int reconfig(struct vo *vo, struct mp_image_params *params)
return -1;
}
resize(vo);
return 0;
}