[MPlayer-dev-eng] mp-g2 pre14

D Richard Felker III dalias at aerifal.cx
Mon Apr 21 22:56:28 CEST 2003


On Mon, Apr 21, 2003 at 10:28:32PM +0200, Arpi wrote:
> Hi,
> 
> > static mp_image_t* process_image(vf_dunno_t* vf, mp_image_t* mpi){
> >     mp_image_t* dmpi;
> >     if(!mpi){
> > 	if(we have pending images?){
> > 	    dmpi=vf_get_image(...)
> > 	    render
> > 	    return dmpi;
> > 	}
> > 	return NULL; // no thanks
> >     }
> >     dmpi=vf_get_image(...)
> >     filter mpi into dmpi
> >     while(we need one more image?){
> > 	mpi=vf_process_image(vf);
> > 	if(!mpi) sorry, no more...
> > 	filter mpi into dmpi
> >     }
> >     return dmpi;
> > }
> 
> maybe we should/could separate the mpi==NULL case, sotmething like
> get_pending_image() and process_image(), the former should return NULL or
> pending image (if implemented at all), the second could always expect
> mpi!=NULL. it would be simpler for converting/writting nromal filters,
> and could help a bit on error-handling (as NULL now may mean error
> and no-image)
> 
> Rich, is it ok to split?

I just think this whole design is rather gross and artificial... It's
like allowing filters to insert or remove frames is a hacked-in
afterthought, rather than a natural consequence of a good design...

Instead of "pending images" I'd like to think in terms of pulling
images out of the end of the chain as they're needed. The vf api is
already confusing enough for people trying to write filters without
all this back-and-forth craziness...

Rich



More information about the MPlayer-dev-eng mailing list