[Ffmpeg-devel] [PATCH] Add sws_getCachedContext() to swscalelibrary
Michael Niedermayer
michaelni
Mon Sep 4 10:25:26 CEST 2006
Hi
On Thu, Aug 31, 2006 at 11:06:53PM +0200, V?ctor Paesa wrote:
> Hi,
>
> > Hi
> >
> > On Thu, Aug 31, 2006 at 07:15:42PM +0200, V?ctor Paesa wrote:
> >> Hi,
> >>
> >> While porting the vhooks to swscale I found myself copying&pasting
> >> the same code over and over, to support streams that change dimensions.
> >>
> >> This function sws_getCachedContext() in the attached patch would save me
> >> a lot of typing, plus increasing legibility.
> >
> > iam fine with the patch, except that a non zero filter forces a reinit
> > IMHO it would be better to assume that the filters didnt change
> >
>
> OK, here is a new patch with that asumption.
[...]
> +/**
> + * Checks if context is valid or reallocs a new one instead.
> + * If context is NULL, just calls sws_getContext() to get a new one.
> + * Otherwise, checks if the parameters are the same already saved in context.
> + * If that is the case, returns the current context.
> + * Otherwise, frees context and gets a new one.
> + *
> + * Be warned that srcFilter, dstFilter are not checked, they are
> + * asumed to remain valid.
> + */
[...]
> +/**
> + * Checks if context is valid or reallocs a new one instead.
> + * If context is NULL, just calls sws_getContext() to get a new one.
> + * Otherwise, checks if the parameters are the same already saved in context.
> + * If that is the case, returns the current context.
> + * Otherwise, frees context and gets a new one.
> + *
> + * Be warned that srcFilter, dstFilter are not checked, they are
> + * asumed to remain valid.
> + */
that comment shouldnt be duplicated, except that iam fine wirh te patch
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list