[vlc-devel] [PATCH] Mirror video filter

Antoine Cellerier dionoea at videolan.org
Sat Jul 18 11:41:14 CEST 2009


As mentioned on IRC, here come a few comments regarding the code.

On Sat, Jul 18, 2009, Branko Kokanovic wrote:
> +static int Create( vlc_object_t *p_this )
> +{

You should check the input and output chroma and picture dimensions here
to make sure that your filter can handle them correctly. An example of
such a check can be found in modules/video_filter/adjust.c Create().

> +    if( p_pic->format.i_chroma == VLC_CODEC_YUVA )
> +    {
> +        /* We don't want to mirror the alpha plane */

Why don't you mirror the alpha plane? The resulting picture will look
completely messed up on the mirrored side if you don't.

You should also see if your code works correctly with packed formats
such as YUYV (well any packed YUV 4:2:2 format) and RV24/32 since a lot
of webcams output such formats and your filter is the kind of filter
people will want to try with webcams. Pixel copies with such packed
formats should be handled by 4 byte chunks, else the resulting copy is
going to be completely messed up, with U and V being swapped for example
in YUYV.


Antoine Cellerier

More information about the vlc-devel mailing list