[Ffmpeg-devel] swscale.h in libavcodec and libswscale

Luca Abeni lucabe72
Mon Oct 16 10:07:33 CEST 2006

Hi Diego,

On Sun, 2006-10-15 at 19:38 +0200, Diego Biurrun wrote:
> We curently have two headers called swscale.h, one in libswscale and one
> in libavcodec.
Yes, I created libavcodec/swscale.h some time ago.
The fact is that now ffmpeg provides the swscale interface for image
rescaling / pixel format conversion even if libswscale is not compile.
This permits to have a consistent interface that can be used regardless
of the fact that --enable-swscaler has been configured or not.

In my opinion, this is not a problem: unless I am missing something, the
correct swscale.h is always included, and "make install" installs the
correct file. Of course, I might be wrong... Let me know, and I'll fix
the problem.

> I stumbled across this after noticing these warnings in vhook/:
> null.c:77: warning: implicit declaration of function 'sws_getCachedContext'
Uhmmm... I guess this is my fault: when sws_getCachedContext has been
added to swscale, I forgot to add it to the swscale emulation code in

> I can easily fix the warnings by adding -I$(SRC_PATH)/libswscale to
> CFLAGS before -I$(SRC_PATH)/libavcodec.
Did you configure with "--enable-swscaler"?
If yes, "-I$(SRC_PATH)/libswscale" should already be before "-I
$(SRC_PATH)/libavcodec" (at least, I think it was when I initially
committed the swscale support). 
If not, then the warning is showing a real problem, and adding "-I
$(SRC_PATH)/libswscale" would just hide it (you would not see any
compilation warning, but the resulting .so file would reference a
non-existing function, and would be unusable). The real fix is to
implement 'sws_getCachedContext' in the swscale emulation. If noone
disagree with this statement, I'll provide a patch in few days.

> IIUC libavcodec/swscale.h is an interim solution added by Panagiotis
> while porting libswscale to FFmpeg.
No, Panagiotis is innocent, I introduced it :)

>   While it be removed eventually?
My idea is that it will be removed when swscale will become the default
(and --enable-swscaler will disappear). 

Of course this is just my opinion... If anyone has better ideas, I am
willing to change my mind and go for a better solution.

Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

More information about the ffmpeg-devel mailing list