[Ffmpeg-devel] [PATCH] Add sws_getCachedContext() toswscalelibrary

Víctor Paesa wzrlpy
Mon Sep 4 11:56:19 CEST 2006


Hi,

> Hi,
>
> On 9/4/06, Michael Niedermayer <michaelni at gmx.at> wrote:
>
>> 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
>
> I stripped the one on the .h, as there weren't any previously, and
> there's a lot more on the .c. If necessary, this can be changed later.
>
> Committed.
>

Sorry for the duplication, and thanks for the commit.

Regards,
V?ctor




More information about the ffmpeg-devel mailing list