[MPlayer-dev-eng] [PATCH] shared memory stream - part 2

Diego Biurrun diego at biurrun.de
Sun Aug 12 14:29:31 CEST 2007


On Sat, Aug 11, 2007 at 11:51:26PM +0200, Ötvös Attila wrote:
> I renamed sharedmem to shmem.
> 
> --- libmpcodecs/vf_shmemin.c	(revision 0)
> +++ libmpcodecs/vf_shmemin.c	(revision 0)
> @@ -0,0 +1,323 @@
> +/*
> + *  vf_shmemin.c
> + *
> + *  Import video frame from shared memory
> + *
> + *  Based on vf_bmovl.c

There is no need to mention the filename here IMO.  Just mention the one
line description and what it is based on.

> + *  Copyright (C) 2007 Attila Ötvös <attila at onebithq.com>
> + *
> + *  This file is part of MPlayer, a free movie player.

"This file is part of MPlayer." is enough.

The same comments apply to the other file you add.

> +static int imgsize(mp_image_t *mpi) {
> +
> +    switch(mpi->imgfmt){
> +	case IMGFMT_I420:
> +	case IMGFMT_IYUV:
> +	case IMGFMT_YV12: 
> +	    return mpi->w*mpi->h+2*(mpi->w>>1)*(mpi->h>>1);
> +	case IMGFMT_YUY2:
> +	case IMGFMT_UYVY:
> +	    return mpi->w*mpi->h*2;
> +	case IMGFMT_Y800:
> +	case IMGFMT_Y8: 
> +	    return mpi->w*mpi->h;
> +	case IMGFMT_BGR24:
> +	case IMGFMT_RGB24:
> +        return mpi->w * mpi->h * ((IMGFMT_RGB_DEPTH(mpi->imgfmt) + 7) >> 3);
> +    }
> +    return 0;
> +}
> +
> +static int imgscalex(mp_image_t *mpi) {
> +
> +    switch(mpi->imgfmt){
> +	case IMGFMT_YUY2:
> +	case IMGFMT_UYVY:
> +        return 2;
> +	    break;

Weird indentation.  Also, please try to avoid tabs.

> +static int
> +query_format(struct vf_instance_s* vf, unsigned int fmt){

I don't like this style of function declaration and you are not using it
consistently anyway.

> --- libmpcodecs/Makefile	(revision 24045)
> +++ libmpcodecs/Makefile	(working copy)
> @@ -126,6 +126,7 @@
>  SRCS_COMMON-$(XANIM_CODECS)          += vd_xanim.c
>  SRCS_COMMON-$(XVID4)                 += vd_xvid4.c
>  SRCS_COMMON-$(ZORAN)                 += vd_zrmjpeg.c vf_zrmjpeg.c
> +SRCS_COMMON-$(SHMEM)                 += vf_shmemout.c vf_shmemin.c

alphabetical order

Also, please try to avoid trailing whitespace.

Diego



More information about the MPlayer-dev-eng mailing list