[MPlayer-dev-eng] MNG support for MPlayer

Diego Biurrun diego at biurrun.de
Tue Sep 16 15:02:06 CEST 2008


On Mon, Sep 15, 2008 at 08:48:07PM +0200, Stefan Schuermans wrote:
>
> The diff attached has been done against current svn version.
>
> --- trunk/configure	2008-09-15 20:26:57.000000000 +0200
> +++ mng-20080915/configure	2008-09-15 20:33:05.000000000 +0200
> @@ -7686,6 +7723,7 @@
>    else
>      $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
>    fi
> +MNG = $_mng
>  fi
>  if test "$_dvdnav" = auto ; then
>    cat > $TMPC <<EOF

This hunk seems to have been misplaced.

> --- trunk/libmpdemux/demux_mng.c	1970-01-01 01:00:00.000000000 +0100
> +++ mng-20080915/libmpdemux/demux_mng.c	2008-09-15 20:33:05.000000000 +0200
> @@ -0,0 +1,487 @@
> +/*
> + * MNG file parser for MPlayer

We usually call this demuxer, not parser.

> +// private context structure
> +//  - used as private data in MPlayer demuxer
> +//  - used as private data in MNG library
> +typedef struct {
> +  demuxer_t * demuxer; // pointer to MPlayer demuxer object
> +  mng_handle h_mng; // handle of MNG library image
> +  int header_processed; // if header of MNG image is processed
> +  mng_uint32 width; // width of MNG image
> +  mng_uint32 height; // height of MNG image
> +  int total_time_ms; // total time of MNG animation (in milliseconds)
> +  unsigned char * canvas; // canvas to draw the image onto
> +                          //  - lines top-down with pixels left-to-right
> +                          //     with channels RGB, no padding
> +                          //  - NULL if no canvas yet
> +  int displaying; // if displaying already (i.e. if mng_display has already been called)
> +  int finished; // if animation is finished
> +  int global_time_ms; // current global time for MNG library (in milliseconds)
> +  int anim_cur_time_ms; // time of current frame in MNG animation (in milliseconds)
> +  int anim_frame_duration_ms; // duration of current frame in MNG animation (in milliseconds)
> +  int show_cur_time_ms; // current time in the show process, i.e. time of last demux packet created (in milliseconds)
> +  int show_next_time_ms; // next time in the show process, i.e. time of next demux packet to create (in milliseconds)
> +  int timer_msecs; // number of milliseconds after which the MNG library want to be called again
> +} mng_priv_t;

The comments could be aligned for better readability.

> +// MNG library callback: allocate a new memmory block and fill it with zeros

memory

> +  // get totel time of animation

total

> +    // clear varibale MNG library will write number of milliseconds to (via settimer callback)

varibale?

> +    // clear varibale MNG library will write number of milliseconds to (via settimer callback)

ditto

> +// descriptior of this MNG demuxer

I think this comment is useless and it should be "descriptor".

Diego



More information about the MPlayer-dev-eng mailing list