[MPlayer-dev-eng] [PATCH 4/9] vo_fbdev2: Enable double buffering and direct rendering

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Feb 16 18:03:43 CET 2009


I think there are changes that fix/implement different things, those
need to be split.
Also always requiring double-buffer might mean some videos no longer
play when very little Video RAM is available.

> +static uint32_t get_image(mp_image_t *mpi)
> +{
> +	if(mpi->flags&MP_IMGFLAG_READABLE)
> +		return VO_FALSE; // slow video ram
> +	if(mpi->type==MP_IMGTYPE_STATIC)
> +		return VO_FALSE; // it is not static

Without double-buffering it would actually be static.

> +	if (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH)) {

Those actually are only necessary when width and stride do not match
anyway.

> +		// we're lucky or codec accepts stride => ok, let's go!
> +
> +		//YUY2 and RGB formats
> +		mpi->planes[0] = center;
> +		mpi->width = in_width;
> +		mpi->stride[0] = fb_line_len;
> +
> +		// center image
> +
> +		mpi->flags |= MP_IMGFLAG_DIRECT;
> +
> +		return VO_TRUE;
> +	}

That misses a few checks, there is
MP_IMGTYPE_EXPORT
MP_IMGTYPE_STATIC
MP_IMGTYPE_TEMP
MP_IMGTYPE_IP
MP_IMGTYPE_IPB
MP_IMGTYPE_NUMBERED

You could probably support MP_IMGTYPE_IP but currently that is pointless
without supporting MP_IMGFLAG_READABLE.
For MP_IMGTYPE_IPB you'd need one more buffer.
Supporting MP_IMGTYPE_NUMBERED should be easy, but pointless currently
since it is not used.
And MP_IMGTYPE_EXPORT makes no sense here.
Or in short, you should probably return false if mpi->type !=
MP_IMGTYPE_TEMP


> +static uint32_t put_image(mp_image_t *mpi)
> +{
> +	// already out?
> +	if ((mpi->flags & (MP_IMGFLAG_DIRECT | MP_IMGFLAG_DRAW_CALLBACK)))

Outermost () is unnecessary.

> +		return VO_TRUE;
> +	return VO_FALSE;

It would also be nicer to call draw_slice yourself instead of taking the
"scenic" route back to vf_vo and from there into draw_slice.



More information about the MPlayer-dev-eng mailing list