[MPlayer-dev-eng] [PATCH] Better double frame rate output and frame limit option.

Vicente Sendra visenri at yahoo.es
Sun Jan 6 21:43:11 CET 2013


--- El dom, 6/1/13, Andy Furniss <andyqos at ukfsn.org> escribió:

> De: Andy Furniss <andyqos at ukfsn.org>
> Asunto: Re: [MPlayer-dev-eng] [PATCH] Better double frame rate output and frame limit option.
> Para: mplayer-dev-eng at mplayerhq.hu
> CC: "Vicente Sendra" <visenri at yahoo.es>
> Fecha: domingo, 6 de enero, 2013 18:34
> Vicente Sendra wrote:
> 
> > I've been thinking about a generic solution for any vo
> that adds frames like vdpau, that will work exactly as the
> other vf do with my patches.
> 
> I don't know if "add frames" is the right way to describe it
> for vdpau - from what I've seen with VDPAU_TRACE=1 it's
> mplayer that calls twice as frequently specifying top or
> bottom to output field rate.
> 
> I can only test Radeon R600 implementation with bob enabled
> by patch using software decode. R600 is not as complete as
> nvidia, so may behave differently (eg. ignore) some vdpau
> timestamps.

Of course, mplayer does two page flips per decoded frame, and it does here:

-------------------------------------------------
static void video_to_output_surface(void)
{
    VdpTime dummy;
    VdpStatus vdp_st;
    int i;
    if (vid_surface_num < 0)
        return;

    if (deint < 2 || deint_surfaces[0] == VDP_INVALID_HANDLE)
        push_deint_surface(surface_render[vid_surface_num].surface);

    for (i = 0; i <= !!(deint > 1); i++) {
        int field = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
        VdpOutputSurface output_surface;
        if (i) {
            draw_eosd();
            draw_osd();
            flip_page();
        }
        if (deint)
            field = (top_field_first == i) ^ (deint > 1) ?
                    VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD:
                    VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD;
        output_surface = output_surfaces[surface_num];
        vdp_st = vdp_presentation_queue_block_until_surface_idle(vdp_flip_queue,
                                                                 output_surface,
                                                                 &dummy);
        CHECK_ST_WARNING("Error when calling vdp_presentation_queue_block_until_surface_idle")

        vdp_st = vdp_video_mixer_render(video_mixer, VDP_INVALID_HANDLE, 0,
                                        field, 2, deint_surfaces + 1,
                                        deint_surfaces[0],
                                        1, &surface_render[vid_surface_num].surface,
                                        &src_rect_vid,
                                        output_surface,
                                        NULL, &out_rect_vid, 0, NULL);
        CHECK_ST_WARNING("Error when calling vdp_video_mixer_render")
        push_deint_surface(surface_render[vid_surface_num].surface);
    }
}
-------------------------------------------------

If deinterlace is active, the for loop is done twice and does an extra flip_page();, that combined with mplayer.c main loop call to flip_page(); makes two calls.

As i said, we have to modify this to avoid the extra flip_page(); and it's associated picture processing, this has to be delayed until we call:

vo_vdpau.c "control" function with VOCTRL_DRAW_FRAME_ADDED.
that will be called from vf_vo.c "continue_buffered_image",
that will be called from vf.c "vf_output_queued_frame",
that will be called from mplayer.c main loop.

(explained in http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2013-January/071274.html )

>From an mplayer.c main loop perspective it will be an added frame, the same way vf_tfields and vf_yadif are right now.



More information about the MPlayer-dev-eng mailing list