[FFmpeg-devel] [PATCH] Vhook on MinGW

Ramiro Ribeiro Polla ramiro
Thu Jun 14 18:50:13 CEST 2007


Diego Biurrun wrote:
> On Sun, Jun 10, 2007 at 03:06:03AM -0300, Ramiro Polla wrote:
>   
>> I know vhook is coming to an end, and I never had to use it, so I never 
>> bothered to try and make it work with MinGW.
>> But someone wanted vhooks on Windows (not with cygwin), and cared to pay 
>> to get it working, and it turns out it's simpler that I thought it would be.
>>
>> MinGW doesn't have libdl, so vhooks will still be disabled for anyone 
>> who doesn't specifically want vhooks and knows what they're doing. 
>> Whoever wants them just needs to create a shared libdl.dll (there are 
>> plenty of implementations around). A static libdl.a doesn't get picked 
>> up by check_func (because of the order it appears on the command line), 
>> and it's not worth changing this in FFmpeg.
>>
>> vhook1.diff
>> Only print the warning in case vhooks have been enabled.
>> vhook2.diff
>> Also print the warning for MinGW.
>> vhook3.diff
>> Make ppm vhook depend on fork().
>> vhook4.diff
>> Copy flags from Cygwin.
>>
>> That's all it takes to get fish, null, and watermark to work wth MinGW.
>>
>> --- configure.orig	Sun Jun 10 05:42:49 2007
>> +++ configure	Sun Jun 10 05:42:52 2007
>> @@ -1168,6 +1168,8 @@
>>      targetos=mingw32
>>      shlibdir="$bindir"
>>      dv1394="no"
>> +    VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libswscale -L$(BUILD_ROOT)/libavutil'
>> +    VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lswscale$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
>>      ffserver="no"
>>      network="no"
>>      SLIBPREF=""
>>     
>
> OK
>
>   

Applied.

>> --- configure.orig	Sun Jun 10 05:37:06 2007
>> +++ configure	Sun Jun 10 05:37:34 2007
>> @@ -1671,7 +1671,7 @@
>>  
>>  enabled_any vhook liba52bin libfaadbin ffserver && add_extralibs $ldl
>>  
>> -if test "$targetos" = cygwin && enabled static ; then
>> +if test "$targetos" = cygwin && enabled_all static vhook ; then
>>      vhook="no"
>>      echo
>>      echo "At the moment vhooks don't work on Cygwin static builds."
>>     
>
> OK
>
>   

Applied.

>> --- configure.orig	Sun Jun 10 05:38:25 2007
>> +++ configure	Sun Jun 10 05:39:54 2007
>> @@ -1671,10 +1671,10 @@
>>  
>>  enabled_any vhook liba52bin libfaadbin ffserver && add_extralibs $ldl
>>  
>> -if test "$targetos" = cygwin && enabled_all static vhook ; then
>> +if test "$targetos" = cygwin -o "$targetos" = mingw32 && enabled_all static vhook ; then
>>      vhook="no"
>>      echo
>> -    echo "At the moment vhooks don't work on Cygwin static builds."
>> +    echo "At the moment vhooks don't work on Cygwin or MinGW static builds."
>>      echo "Patches welcome."
>>      echo
>>  fi
>>     
>
> OK
>
>   

Applied.

>> --- configure.orig	Sun Jun 10 05:40:05 2007
>> +++ configure	Sun Jun 10 05:40:16 2007
>> @@ -1667,6 +1667,8 @@
>>      ldl=-ldl
>>  fi
>>  
>> +check_func fork
>> +
>>  test "$vhook" = "default" && vhook="$dlopen"
>>  
>>  enabled_any vhook liba52bin libfaadbin ffserver && add_extralibs $ldl
>> --- vhook/Makefile.orig	Sun Jun 10 05:41:07 2007
>> +++ vhook/Makefile	Sun Jun 10 05:40:54 2007
>> @@ -6,9 +6,13 @@
>>  
>> -HOOKS=null$(SLIBSUF) fish$(SLIBSUF) ppm$(SLIBSUF) watermark$(SLIBSUF)
>> +HOOKS=null$(SLIBSUF) fish$(SLIBSUF) watermark$(SLIBSUF)
>>  ALLHOOKS=$(HOOKS) imlib2$(SLIBSUF) drawtext$(SLIBSUF)
>>  
>> +ifeq ($(HAVE_FORK),yes)
>> +    HOOKS += ppm$(SLIBSUF)
>> +endif
>>     
>
> You missed ALLHOOKS.
>
>   

Applied adding ppm$(SLIBSUF) to ALLHOOKS.

Ramiro Polla




More information about the ffmpeg-devel mailing list