[FFmpeg-devel] [PATCH] make img_convert symbol conditional on lavc version, not libswscale

Michael Niedermayer michaelni
Fri Jun 6 23:35:28 CEST 2008


On Fri, Jun 06, 2008 at 04:25:30PM +0200, Diego Biurrun wrote:
> On Thu, Jun 05, 2008 at 05:20:46PM +0200, Michael Niedermayer wrote:
> > On Thu, Jun 05, 2008 at 04:58:25PM +0200, Diego Biurrun wrote:
> > > On Thu, Jun 05, 2008 at 04:35:05PM +0200, Michael Niedermayer wrote:
> > > > On Thu, Jun 05, 2008 at 09:52:13AM +0200, Diego Biurrun wrote:
> > > > > On Thu, Jun 05, 2008 at 12:38:11AM -0700, Baptiste Coudurier wrote:
> > > > > > 
> > > > > > Diego Biurrun wrote:
> > > > > > > On Tue, Jun 03, 2008 at 01:46:18PM +0200, Diego Biurrun wrote:
> > > > > > >> Currently we declare img_convert() in avcodec.h conditional to
> > > > > > >>
> > > > > > >> #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
> > > > > > >>
> > > > > > >> However, in imgconvert.c, img_convert is defined conditional to
> > > > > > >>
> > > > > > >> #ifndef CONFIG_SWSCALE
> > > > > > >>
> > > > > > >> so that img_convert() is not available when compiling with swscale
> > > > > > >> enabled although it is declared in avcodec.h.
> > > > > > >>
> > > > > > >> Here is a patch to change the condition in imgconvert.c, which I believe
> > > > > > >> is the correct solution.
> > > > > > > 
> > > > > > > I will commit this tomorrow unless I hear objections.
> > > > > > 
> > > > > > imgresample.c uses img_convert, is it safe ?
> > > > > 
> > > > > That is indeed a problem, but separate from the one my patch addresses.
> > > > > The header promises the symbol conditional on lavc version, so the
> > > > > implementation must IMO follow.  We cannot make a condition based on
> > > > > CONFIG_SWSCALE in avcodec.h because installed headers do not #include
> > > > > config.h.
> > > > 
> > > > Iam not completely sure what is the correct awnser but
> > > >  --enable-swscale means "use the new API", one should not use that and then
> > > >  complain that the old isnt available anymore ...
> > > 
> > > But our header says that it is still available and the condition in the
> > > header contradicts the condition in the implementation.  So something
> > > must be buggy...
> > 
> > well then, it should not be in the header when sws is enabled.
> 
> Then how about adding the declarations to imgconvert.h and installing
> that header depending on swscale being enabled or not?

imgconvert.h is a internal header ...


>  Alternatively, I
> could add an option to configure --disable-oldscaler or whatever that
> controls enabling this code.

Why not just add a big warning to --enable-swscale like:

"Warning, libavcodec has been compiled with the new scaler and
 applications which still use the old scaler will not work with this
 version of libavcodec, the regression tests will not work either"

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080606/efa0265a/attachment.pgp>



More information about the ffmpeg-devel mailing list