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

Víctor Paesa wzrlpy
Mon Oct 23 10:02:58 CEST 2006


Hi,
>
> Hi,
>
> On 2006-10-22 13:51:43 -0500, V?ctor Paesa <wzrlpy at arsystel.com> said:
>
>> Hi Luca,
>>
>>> Hi Diego,
>>>
>>> On Fri, 2006-10-20 at 00:12 +0200, Diego Biurrun wrote:
>>> [...]
>>>>> The attached patch is still not perfect (I think "make install" will
>>>> not
>>>>> work), but if you think that something like this should be committed
>>>>> I'll prepare a correct and more tested version.
>>>>>
>>>>> --- libavcodec/Makefile	(revision 6713)
>>>>> +++ libavcodec/Makefile	(working copy)
>>>>> @@ -4,6 +4,7 @@
>>>>> #
>>>>> include ../config.mak
>>>>>
>>>>> +CFLAGS+=-I$(SRC_PATH)/libswscale
>>>>> CFLAGS+=$(AMR_CFLAGS)
>>>>
>>>> CFLAGS+=-I$(SRC_PATH)/libswscale $(AMR_CFLAGS)
>>>>
>>>> Apart from that the patch looks fine to me.
>>> Ok, I made this change and I also fixed "make install" (I hope I did it
>>> in the proper way). If noone complains, I'll apply this tomorrow.
>>>
>> Great work, but Cygwin mercyless complains on undefined references
>> and swcaler references libavutil so I got these errors:
>>
>> gcc -shared -Wl,--out-implib=libswscale.dll.a -Wl,--warn-common   -pthr
>> ead
>> -rdynamic -export-dynamic
>> -Wl,-rpath-link,/home/Inma/src/ffmpeg-svn/ffmpeg/libavcodec
>> -Wl,-rpath-link,/home/Inma/src/ffmpeg-svn/ffmpeg/libavformat
>> -Wl,-rpath-link,/home/Inma/src/ffmpeg-svn/ffmpeg/libavutil -o
>> cygswscale-0.dll swscale.o rgb2rgb.o yuv2rgb.o -lz -lmp3lame -lvfw32
>> gcc: unrecognized option `-pthread'
>> gcc: unrecognized option `-rdynamic'
>> swscale.o: In function `swScale_MMX':
>> /home/Inma/src/ffmpeg-svn/ffmpeg/libswscale/swscale_template.c:2921:
>> undefined reference to `_av_log'
>> swscale.o: In function `sws_freeVec':
>> /home/Inma/src/ffmpeg-svn/ffmpeg/libswscale/swscale.c:2650: undefined
>> reference to `_av_free'
>> swscale.o: In function `initFilter':
>> /home/Inma/src/ffmpeg-svn/ffmpeg/libswscale/swscale.c:920: undefined
>> reference to `_av_malloc'
>> /home/Inma/src/ffmpeg-svn/ffmpeg/libswscale/swscale.c:926: undefined
>> reference to `_av_malloc'
>> /home/Inma/src/ffmpeg-svn/ffmpeg/libswscale/swscale.c:1100: undefined
>> reference to `_av_malloc'
>> [...]
>>
>>
>> I added this line on top of your patch:
>> ========================= ========================= ================
>> --- libswscale/Makefile (revision 20371)
>> +++ libswscale/Makefile (working copy)
>> @@ -7,6 +7,8 @@
>>  LIBMAJOR=$(SWSMAJOR)
>>  endif
>>
>> +EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF)
>> +
>>  OBJS= swscale.o rgb2rgb.o yuv2rgb.o
>>  ifeq ($(TARGET_ALTIVEC),yes)
>>  OBJS+=  yuv2rgb_altivec.o
>>
>> Regards,
>> V?ctor
>
> I was going to report _av_* missing symbols at linktime when
> --enable-swscaler is in effect for building on Darwin/OSX also.
> Unfortunately I don't want EXTRALIBS to be overridden as in the above
> patch because I'm presently using it to fix other link problems on OSX
> (I hope to figure them out & submit more patches if needed, later).
> Instead, I am presently using this patch for libswscale/Makefile:
>>>>>
> --- libswscale/Makefile_orig	2006-10-23 02:06:25 -0500
> +++ libswscale/Makefile	2006-10-23 01:59:16 -0500
> @@ -14,6 +14,8 @@
>
>  HEADERS = swscale.h rgb2rgb.h
>
> +SHFLAGS+=-L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF)
> +
>  include $(SRC_PATH)/common.mak
>
>  cs_test: cs_test.c $(LIB)
>
> <<<<
> This file libswscale/Makefile is at r20154 itself as I send this
> message, and needs to apply to ffmpeg and mplayer trees both.
>

You're right, $EXTRALIBS would be overwritten. This should be better:

===================================================================
--- libswscale/Makefile (revision 20302)
+++ libswscale/Makefile (working copy)
@@ -7,6 +7,8 @@
 LIBMAJOR=$(SWSMAJOR)
 endif

+EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
+
 OBJS= swscale.o rgb2rgb.o yuv2rgb.o
 ifeq ($(TARGET_ALTIVEC),yes)
 OBJS+=  yuv2rgb_altivec.o

Changing $SHFLAGS would fix only dynamic libraries builds.

Regards,
V?ctor




More information about the ffmpeg-devel mailing list