[MPlayer-cygwin] Some mingw oddities.

Stefan Gürtler helfmir at surfeu.de
Wed Dec 8 21:19:32 CET 2004


Erik Augustson schrieb:

>Greetings,
>
>With a bit of hacking, I was recently able to add toolame and x264 support
>under mingw. I'm sure there are some better fixes, but here are the problems
>I encountered nonetheless:
>
>The x264 codec from videolan.org is too old, and rather than trying to compile
>subversion in mingw (too time consuming), I CVS'd ffdshow which has a mingw
>usable x264 codec in ffdshow/src/codecs/x264. This will make an appropriate
>ff_x264.dll, and has all the necessary headers of course to compile mplayer
>against x264. I then proceeded to install toolame-02.m-beta8, both of which
>compiled *out-of-the-box*, copied the appropriate headers to /mingw/include,
>libraries to /mingw/lib and binaries to /mingw/bin (neither of which had a
>make install rule).
>
>Configure went smoothly and detected both, so I then began compiling.
>
>First error i encountered was:
>
>In file included from ve_x264.c:50:
>C:/mingw/include/x264.h:117: parse error before "va_list"
>ve_x264.c:52:5: string constants are not valid in #if
>make[1]: *** [ve_x264.o] Error 1
>make[1]: Leaving directory `/mingw/MPlayer-20041206/libmpcodecs'
>make: *** [libmpcodecs/libmpcodecs.a] Error 2
>
>After a bit of googling and digging, I found that changing the line at 117 in
>x264.h...
>-void    (*pf_log)( void *, int i_level, const char *psz, va_list );
>+void    (*pf_log)( void *, int i_level, const char *psz, __gnuc_va_list );
>was the fix (see /mingw/lib/gcc-lib/mingw32/3.2.3/include/stdarg.h) for x264,
>and I had to comment out:
>#if X264_BUILD < 0x000c
>#error We do not support old versions of x264. Get the latest from SVN.
>#endif
>in libmpcodecs/ve_x264.c @ line 52
>
>This fixed x264, the next error I encountered was at the final linking stage,
>there was a multiple definition of `freq2bark' in both libmp3lame.a(util.o) and
>libtoolame.a(ath.o), which resulted in a make: Error 1. I fixed this by 
>removing the duplicated freq2bark from toolame at the bottom of libtoolame/ath.c
>(which was borrowed from lame anyways) and reinstalling libtoolame. This fixed
>the final linking, and mplayer and mencoder both compiled fine. The only problem
>with this was, after removing freq2bark and reinstalling libtoolame.a, configure
>won't find toolame after this fix. I'm sure you could #define HAVE_TOOLAME 1 in
>config.h and add -ltoolame in config.mak even if configure doesn't pick it up,
>but i'm curious if there's a way to modify how configure checks for it under
>mingw.
>
>Regards,
>Erik
>
>P.S. If anyone is interested in testing them, I zipped them up and you can get
>them at http://vayne.fdns.net. It's vanilla mplayer source + reimar's vo_gl
>reworked patch. I haven't tested encoding yet with either x264 or toolame, so
>i'm curious how they're working.
>
>_______________________________________________
>MPlayer-cygwin mailing list
>MPlayer-cygwin at mplayerhq.hu
>http://mplayerhq.hu/mailman/listinfo/mplayer-cygwin
>
>  
>
I am able to compile x264 source out of the box" on my PIII using the 
Makefile in build\cygwin in msys environment. I just had to download and 
compile the nasm code ahead of compiling x264. There was nothing special 
to do to build nasm, too.
For downloading x264 source, I use svxn-win32-1.1.0 binaries from svn 
homepage with this batch-file:

REM Skript zum runterladen des aktuellen Quelltext von x264
svn-win32-1.1.0\bin\svn co svn://svn.videolan.org/x264/trunk x264
PAUSE

I needed to copy the libx264.so and x264.h to appropriate folders of 
MSYS after compiling, to get mplayer recognizing the files.
One used to have to include x264.h in libavcodec/avcodec.h. If compiling 
mplayer fails, you can try to modify the header and retry.

Here is the output from building x264:

Admin at ALDIKISTE ~/x264_rev66/build/cygwin
$ make
 D: /home/Admin/x264_rev66/build/cygwin/bin
 C: core/mc.c
 C: core/predict.c
D:/Stefan/msys/1.0/home/Admin/x264_rev66/core/predict.c: In function 
`predict_4x                                             4_vr':
D:/Stefan/msys/1.0/home/Admin/x264_rev66/core/predict.c:536: warning: 
unused var                                             iable `l3'
D:/Stefan/msys/1.0/home/Admin/x264_rev66/core/predict.c: In function 
`predict_4x                                             4_hd':
D:/Stefan/msys/1.0/home/Admin/x264_rev66/core/predict.c:569: warning: 
unused var                                             iable `t3'
D:/Stefan/msys/1.0/home/Admin/x264_rev66/core/predict.c: In function 
`predict_4x                                             4_vl':
D:/Stefan/msys/1.0/home/Admin/x264_rev66/core/predict.c:593: warning: 
unused var                                             iable `t7'
 C: core/pixel.c
 C: core/macroblock.c
 C: core/frame.c
 C: core/dct.c
 C: core/cpu.c
 C: core/cabac.c
 C: core/common.c
 C: core/mdate.c
 C: core/csp.c
 C: encoder/analyse.c
 C: encoder/me.c
 C: encoder/ratecontrol.c
 C: encoder/set.c
 C: encoder/macroblock.c
 C: encoder/cabac.c
 C: encoder/cavlc.c
 C: encoder/encoder.c
 C: encoder/eval.c
 C: core/i386/mc-c.c
 C: core/i386/dct-c.c
 C: core/i386/predict.c
 A: core/i386/dct.asm
 A: core/i386/cpu.asm
 A: core/i386/pixel.asm
 A: core/i386/mc.asm
 L: libx264.a
 C: ./x264.c
 L: x264.exe

Admin at ALDIKISTE ~/x264_rev66/build/cygwin



Hellfred




More information about the MPlayer-cygwin mailing list