BuildingGstPluginsBadInMinGWMsys

Back to contents

Before you start

Consider the fact that this plugin collection is called "bad" for a reason. It contains a lot of plugins and most of them are rarely used, or broken, or inefficient, or undocumented, or all of these at the same time. If one or another -bad plugin is not mentioned here, you should imply that it just doesn't work or is disabled by default, which means that i did not bother to try to build it. By the way, you can always try it yourself and make some additions to this page.

Install optional packages

libass

Go to http://code.google.com/p/libass/downloads/list

Download the latest libass source package:

libass-0.9.9.tar.bz2

Unpack to c:\src

cd /c/src/libass-0.9.9
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install celt

Get celt-0.7.1 from http://www.celt-codec.org/downloads/ Unpack to c:/src

cd /c/src/celt-0.7.1
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install Dirac

Go to http://sourceforge.net/projects/dirac/files/dirac-codec/

Download the latest dirac source package:

dirac-1.0.2.tar.gz

Unpack to c:\src

Modify c:\src\dirac-1.0.2\libdirac_encoder\quant_chooser.cpp:

Replace

            if ( (std::abs(m_coeff_data[j][i])<<2) >= u_threshold )

with

            if ( (static_cast<int>(std::abs(m_coeff_data[j][i]))<<2) >= u_threshold )

Replace

            val = std::max( val , std::abs(m_coeff_data[j][i]) );

with

            val = std::max( val , static_cast<int>(std::abs(m_coeff_data[j][i])) );

Modify c:\src\dirac-1.0.2\util\conversion\common\setstdiomode.cpp:

Replace

namespace dirac_vu { //dirac video utilities namespace

#ifdef _WIN32

#include <stdio.h>  //Defines _fileno (needed to set standard i/o to binary mode)
#include <io.h>     //Defines _setmode (needed to set standard input to binary mode)
#include <fcntl.h>  //Contains definition of _O_BINARY

with

#ifdef _WIN32

#include <stdio.h>  //Defines _fileno (needed to set standard i/o to binary mode)
#include <io.h>     //Defines _setmode (needed to set standard input to binary mode)
#include <fcntl.h>  //Contains definition of _O_BINARY

#endif

namespace dirac_vu { //dirac video utilities namespace

#ifdef _WIN32

Do:

CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install libdca

cd /c/src
svn co svn://svn.videolan.org/libdca/trunk libdca
cd libdca
./bootstrap
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install faac

Go to http://sourceforge.net/projects/faac/files/faac-src/

Download the latest faac source package:

faac-1.28.tar.bz2

Unpack to c:\src

Modify c:\src\faac-1.28\common\mp4v2\mpeg4ip.h:

Replace

#ifndef _WIN32

with

#ifndef _MSC_VER

and

#ifdef _WIN32

with

#ifdef _MSC_VER

Replace

#include <unistd.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <syslog.h>
#include <string.h>
#include <ctype.h>
#include <netdb.h>
#include <sys/stat.h>

with

#include <unistd.h>
#include <fcntl.h>
#ifndef _WIN32
#include <netinet/in.h>
#else
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#include <sys/types.h>
#ifndef _WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <syslog.h>
#endif
#include <string.h>
#include <ctype.h>
#ifndef _WIN32
#include <netdb.h>
#endif
#include <sys/stat.h>

Replace

#ifndef HAVE_SOCKLEN_T
typedef unsigned int socklen_t;
#endif

with

#ifndef HAVE_SOCKLEN_T
#ifndef _WIN32
typedef unsigned int socklen_t;
#endif
#endif

Replace

#ifdef sun
#include <limits.h>
#define u_int8_t uint8_t
#define u_int16_t uint16_t
#define u_int32_t uint32_t
#define u_int64_t uint64_t
#define __STRING(expr) #expr
#endif

with

#if defined(sun) || defined(_WIN32)
#include <limits.h>
#define u_int8_t uint8_t
#define u_int16_t uint16_t
#define u_int32_t uint32_t
#define u_int64_t uint64_t
#define __STRING(expr) #expr
#endif
#if defined(_WIN32)
typedef unsigned int uint;
#define LOG_EMERG 0
#define LOG_ALERT 1
#define LOG_CRIT 2
#define LOG_ERR 3
#define LOG_WARNING 4
#define LOG_NOTICE 5
#define LOG_INFO 6
#define LOG_DEBUG 7
#define srandom srand
#define random rand
#endif

Modify c:\src\faac-1.28\common\mp4v2\mp4util.h:

Replace

#ifndef _WIN32

with

#ifndef _MSC_VER

cd /c/src/faac-1.28
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" LIBS="-lws2_32" ./configure
make
make install

Install faad

Go to http://sourceforge.net/projects/faac/files/faad2-src/

Download the latest faad2 source package:

faad2-2.7.tar.bz2

Unpack to c:\src

Modify c:\src\faad2-2.7\Makefile.in:

Change

SUBDIRS = libfaad common frontend plugins

to

SUBDIRS = libfaad

Modify c:\src\faad2-2.7\include\neaacdec.h:

Change (twice!)

#ifdef _WIN32

to

#ifdef _MSC_VER

cd /c/src/faad2-2.7
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install libgsm

Go to http://user.cs.tu-berlin.de/~jutta/toast.html

Download latest libgsm source package:

gsm-1.0.13.tar.gz

If that site is dead, get it from http://www.imagemagick.org/download/delegates/ffmpeg/gsm-1.0.13.tar.gz

Unpack to c:\src

Create a file c:\src\gsm-1.0.-pl13\Makefile.diff with following contents:

--- Makefile.org        2006-04-26 19:14:26 +0000
+++ Makefile    2009-06-15 14:39:09 +0000
@@ -71,7 +71,7 @@
 # Leave INSTALL_ROOT empty (or just don't execute "make install") to
 # not install gsm and toast outside of this directory.
 
-INSTALL_ROOT   =
+INSTALL_ROOT   = /usr/local
 
 # Where do you want to install the gsm library, header file, and manpages?
 #
@@ -80,7 +80,7 @@
 
 GSM_INSTALL_ROOT = $(INSTALL_ROOT)
 GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
-GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
+GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
 GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
 
 
@@ -140,10 +140,11 @@
 # Targets
 
 LIBGSM = $(LIB)/libgsm.a
+LIBGSM_DLL    = $(BIN)/libgsm.dll
 
-TOAST  = $(BIN)/toast
-UNTOAST        = $(BIN)/untoast
-TCAT   = $(BIN)/tcat
+TOAST  = $(BIN)/toast.exe
+UNTOAST        = $(BIN)/untoast.exe
+TCAT   = $(BIN)/tcat.exe
 
 # Headers
 
@@ -257,6 +258,7 @@
 # Install targets
 
 GSM_INSTALL_TARGETS =  \
+               $(TOAST_INSTALL_BIN)/libgsm.dll         \
                $(GSM_INSTALL_LIB)/libgsm.a             \
                $(GSM_INSTALL_INC)/gsm.h                \
                $(GSM_INSTALL_MAN)/gsm.3                \
@@ -279,7 +281,7 @@
 
 # Target rules
 
-all:           $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
+all:           $(LIBGSM) $(LIBGSM_DLL) $(TOAST) $(TCAT) $(UNTOAST)
                @-echo $(ROOT): Done.
 
 tst:           $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
@@ -304,6 +306,9 @@
                $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
                $(RANLIB) $(LIBGSM)
 
+$(LIBGSM_DLL): $(LIBGSM)
+               $(LD) $(LDFLAGS) $(LIBS) $(GSM_OBJECTS) -shared -o $(LIBGSM_DLL)
+
 
 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
 
@@ -399,6 +404,12 @@
                chmod 444 $@
 
 
+$(TOAST_INSTALL_BIN)/libgsm.dll:       $(LIBGSM_DLL)
+               -rm $@
+               cp $? $@
+               chmod 444 $@
+
+
 # Distribution
 
 dist:          gsm-1.0.tar.Z

Modify c:\src\gsm-1.0-pl13\inc\config.h:

Remove lines

#define    HAS_FCHMOD     1        /* fchmod syscall        */

and

#define    HAS_FCHOWN     1        /* fchown syscall        */

and

#define    HAS_CHOWN     1        /* chown syscall        */

cd /c/src/gsm-1.0-pl13
patch -u Makefile Makefile.diff
make
make install

Install jasper

Go to http://www.ece.uvic.ca/~mdadams/jasper/#download

Download latest jasper source package:

jasper-1.900.1.zip

Unpack to c:\src

Modify c:\src\jasper-1.900.1\src\appl\tmrdemo.c:

Change

    sleep(1);

to

    usleep(1000);

Modify c:\src\jasper-1.900.1\src\libjasper\include\jasper\jas_config.h.in:

Remove lines

/* Name of package */
#undef PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#undef PACKAGE_NAME

/* Define to the full name and version of this package. */
#undef PACKAGE_STRING

/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME

/* Define to the version of this package. */
#undef PACKAGE_VERSION

Remove lines

/* Version number of package */
#undef VERSION

cd /c/src/jasper-1.900.1
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure --enable-shared
make
make install

Install libkate

Go to http://code.google.com/p/libkate/downloads/list

Download the latest libkate source package:

libkate-0.3.7.tar.gz

Modify c:\src\libkate-0.3.7\tools\kpng.c:

Replace all occurrences of:

png_infopp_NULL

with

(png_infopp) NULL

Unpack to c:\src

cd /c/src/libkate-0.3.7
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install libexif

Go to http://sourceforge.net/projects/libexif/files/

Download the latest libexif source package:

libexif-0.6.19.tar.bz2

Unpack to c:\src

cd /c/src/libexif-0.6.19
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install libmimic

Go to https://sourceforge.net/projects/farsight/files/

Download the latest libmimic source package:

libmimic-1.0.4.tar.gz

Unpack to c:\src

cd /c/src/libmimic-1.0.4
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install modplug

Go to http://sourceforge.net/projects/modplug-xmms/files/libmodplug/

Download latest libmodplug source package:

libmodplug-0.8.8.tar.gz

Unpack to c:\src

Modify c:\src\libmodplug-0.8.8\src\Makefile.in:

Remove

-lm

from the line

libmodplug_la_LIBADD = -lm

cd /c/src/libmodplug-0.8.8
CPPFLAGS="-fno-common -I/usr/local/include" LDFLAGS="-no-undefined -L/usr/local/lib" ./configure
make
make install

Install mjpegtools

Go to http://sourceforge.net/project/showfiles.php?group_id=5776&package_id=5823

Download latest mjpegtools package:

mjpegtools-1.9.0.tar.gz

Unpack to c:\src

mjpegtools-1.9.0-mingw-script.tar.bz2

Unpack to c:\src\mjpegtools-1.9.0

cd /c/src/mjpegtools-1.9.0
patch -p0 -u < mjpegtools-1.9.0-mingw.patch
mjpegtools-1.9.0.sh --shared –prefix=/usr/local
CPPFLAGS="-fno-common -I/usr/local/include" LDFLAGS="-no-undefined -L/usr/local/lib -Wl,--enable-runtime-pseudo-reloc-v2" LIBS="-lpthread" ./configure

Modify C:\src\mjpegtools-1.9.0\utils\mjpeg_logging.h:

Remove line

#define usleep(a) Sleep(a/1000)

Modify c:\src\mjpegtools-1.9.0\utils\mjpeg_logging.c:

Change:

_argv

to

__argv

Modify C:\src\mjpegtools-1.9.0\Makefile:

Completely remove the line

    lavtools \

Do:

make
make install

Install libmpc

Go to http://www.musepack.net/index.php?pg=src

Download latest libmpcdec source package:

libmpcdec-1.2.6.tar.bz2

Unpack to c:\src

Modify c:\src\libmpcdec-1.2.6\include\mpcdec\huffman.h and .mpcdec.h:

Replace

#ifndef WIN32

with

#ifndef _MSC_VER

cd /c/src/libmpcdec-1.2.6
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install neon

Go to http://www.webdav.org/neon/

Download latest neon source package:

neon-0.29.3.tar.gz

Unpack to c:\src

cd /c/src/neon-0.29.3
CPPFLAGS="-fno-common -I/usr/local/include" LDFLAGS="-no-undefined -L/usr/local/lib" ./configure --enable-shared
make
make install

ofa

Install curl

Go to http://curl.haxx.se/download.html

Download latest libcurl source package:

curl-7.20.1.tar.bz2

Unpack to c:\src

cd /c/src/curl-7.20.1
CPPFLAGS="-fno-common" LDFLAGS="-no-undefine" ./configure
make
make install

Install fftw

Go to http://www.fftw.org/download.html

Download latest fftw source package:

fftw-3.2.2.tar.gz

Unpack to c:\src

cd /c/src/fftw-3.2.2
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" LIBS="-lpthread" ./configure --enable-shared --with-our-malloc16 --disable-static  --with-windows-f77-mangling  --enable-threads --with-combined-threads  --enable-portable-binary --enable-sse2
make
make install

Install libofa

Go to http://code.google.com/p/musicip-libofa/downloads/list

Download latest libofa source package:

libofa-0.9.4.tar.gz

Unpack to c:\src

cd /c/src/libofa-0.9.4
CPPFLAGS="-fno-common -I/usr/local/include" LDFLAGS="-no-undefined -L/usr/local/lib" ./configure

Modify c:\src\libofa-0.9.4\lib\JAMA\tnt_math_utils.h:

Move lines

/**
    @returns the absolute value of a real (no-complex) scalar.
*/
template <class Real>
Real abs(const Real &a)
{
    return  (a > 0 ? a : -a);
}

to the line 22, right after

namespace TNT
{

Modify c:\src\libofa-0.9.4\lib\signal_op.cpp:

Replace all call to abs() with calls to TNT::abs()

Add line

#include "JAMA/tnt_math_utils.h"

at line 19, after

#include "error_op.h"

Modify c:\src\libofa-0.9.4\examples\example.cpp:

Add the line

#include <cstring>

at line 11, right after

#include "protocol.h"

Modify c:\src\libofa-0.9.4\examples\protocol.h:

Add the line

#include <stdio.h>

at line 14, right after

#include "ofa1/ofa.h"

Modify c:\src\libofa-0.9.4\lib\fftlibw3_op.cpp, fft_op.h:

Replace

#ifdef WIN32

with

#ifdef _MSC_VER

Do:

make
make install

Modify c:\msys\1.0.11\local\lib\libofa.la:

Remove

-lm

from the line

dependency_libs=' -L/usr/local/lib -lm /usr/local/lib/libfftw3.la -lpthread'

Install libdvdnav

Go to http://www1.mplayerhq.hu/MPlayer/releases/dvdnav/

Download latest libdvdnav source package:

libdvdnav-4.1.3.tar.bz2

Unpack to c:\src

CFLAGS="-fno-common -I/usr/local/include" LDFLAGS="-no-undefined -L/usr/local/lib" LIBS="-ldvdread" ./autogen.sh
make
make install

Install SDL

Go to http://www.libsdl.org/download-1.2.php

Download latest SDL 1.2 package:

SDL-devel-1.2.14-mingw32.tar.gz

Unpack to c:\msys\1.0.11\local

Copy everything from c:\msys\local\1.0.11\SDL-1.2.14 to c:\msys\1.0.11\local and delete c:\msys\1.0.11\local\SDL-1.2.14

Modify c:\msys\local\1.0.11\bin\sdl-config:

Change

    --libs)
      echo -L${exec_prefix}/lib -lmingw32 -lSDLmain -lSDL  -mwindows
      ;;

to

    --libs)
      echo -L${exec_prefix}/lib -lSDL  -mwindows
      ;;

Modify c:\msys\local\include\SDL\SDL_config.h:

Change

/* #undef HAVE_ICONV_H */

to

#define HAVE_ICONV_H 1

and

/* #undef HAVE_ICONV */

to

#define HAVE_ICONV 1

Install libsndfile

Go to http://www.mega-nerd.com/libsndfile/#Download

Download latest sndfile source package:

libsndfile-1.0.21.tar.gz

Unpack to c:\src

cd /c/src/libsndfile-1.0.21
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install SoundTouch

Go to http://www.surina.net/soundtouch/index.html#download

Download http://www.surina.net/soundtouch/soundtouch-1.4.0.tar.gz source package:

Unpack to c:\src

Modify c:\src\soundtouch\include\SSTypes.h:

Change

            #if WIN32

to

            #if _MSC_VER

Modify c:\src\soundtouch\include\soundtouch_config.h.in:

Remove lines

/* Name of package */
#undef PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#undef PACKAGE_NAME

/* Define to the full name and version of this package. */
#undef PACKAGE_STRING

/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME

/* Define to the version of this package. */
#undef PACKAGE_VERSION

Remove lines

/* Version number of package */
#undef VERSION

cd /c/src/soundtouch
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure --enable-shared
make
make install

Install timidity

Go to http://sourceforge.net/project/showfiles.php?group_id=124847&package_id=136481

Download latest libtimidity source package:

libtimidity-0.1.0.tar.bz2  

Unpack to c:\src

Modify c:\src\libtimidity-0.1.0\src\configure:

Remove

-lm

from the line

  LIBTIMIDITY_LIBS="$TIMIDITY_LIBS -lm"

cd /c/src/libtimidity-0.1.0
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install wildmidi

Go to http://sourceforge.net/projects/wildmidi/files/wildmidi/

Download latest wildmidi source package:

wildmidi-0.2.2.tar.gz

Unpack to c:\src

Modify c:\src\wildmidi-0.2.2\src\wildmidi_lib.c:

Change line 660

    return data;

to

    return (unsigned char *) data;

Change line 802

        strcpy(line_buffer, &config_buffer[line_start_ptr]);

to

        strcpy(line_buffer, (char *) &config_buffer[line_start_ptr]);

Change line 3443

    if (strncmp(mididata,"RIFF",4) == 0)

to

    if (strncmp((char*) mididata,"RIFF",4) == 0)

Change line 3446

    if (strncmp(&mididata[midiofs],"MThd",4) != 0) {

to

    if (strncmp((char*) &mididata[midiofs],"MThd",4) != 0) {

Change line 3520

        if (strncmp(&mididata[midiofs],"MTrk",4) != 0) {

to

        if (strncmp((char*) &mididata[midiofs],"MTrk",4) != 0) {

Modify c:\src\wildmidi-0.2.2\ltmain.sh:

Change

        test "X$arg" = "X-lc" && continue

to

        continue

cd /c/src/wildmidi-0.2.2
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install xvid

Go to http://www.xvid.org/Downloads.43.0.html

Download latest XviD source package:

xvidcore-1.2.2.tar.gz

Unpack to c:\src

Modify c:\src\xvidcore\build\generic\configure:

Replace

        STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)"
        SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)"

with

        STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
        SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)"

Replace

       yasm_minor=`$yasm_prog --version | cut -d '.' -f 2 | cut -d ' ' -f 1`

with

       yasm_minor=10

cd /c/src/xvidcore/build/generic
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install
mv /usr/local/lib/xvidcore.dll /usr/local/bin/
cp ./=build/xvidcore.dll.a /usr/local/lib/libxvidcore.dll.a

zbar

Get zbar-0.10.tar.bz2 from http://zbar.sourceforge.net/download.html

Modify Makefile.in: Replace

@WIN32_TRUE@    $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $<

with

@WIN32_TRUE@    $(AM_CPPFLAGS) -o $@ $<

cd /c/src/zbar-0.10
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure --without-imagemagick --without-gtk --without-python --without-qt --with-jpeg=no --enable-video=no
make

Delete zbar/libzbar-rc.lo and zbar/libzbar-rc.o

make
make install

rsvg

Install croco

Get libcroco-0.6.2.tar.bz2 from ftp://ftp.gnome.org/pub/GNOME/sources/libcroco/

cd /c/src/libcroco-0.6.2
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Install rsvg

Get librsvg-2.26.2.tar.bz2 from http://ftp.gnome.org/pub/GNOME/sources/librsvg

cd /c/src/librsvg-2.26.2
CPPFLAGS="-fno-common" LDFLAGS="-no-undefined" ./configure
make
make install

Configure things for directdrawsink and directsoundsrc

See gst-plugins-good page for the instructions on downloading, installing DirectX SDK and for obtaining a short path to include directory.

Use and fix MS SDK headers

Get Windows Platform SDK, find files msacm.h and mmreg.h in it and copy them into accessible location, such as /mingw/include/mssdk

Edit each of these files there, change

#if _MSC_VER > 1000

to

#if defined(_MSC_VER) && _MSC_VER > 1000

Build gst-plugins-bad

cd /c/src
git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-bad
cd gst-plugins-bad
ACMMP3DEC_CFLAGS="-I/mingw/include/mssdk" ACMENC_CFLAGS="-I/mingw/include/mssdk" DIRECTX_CFLAGS="-I/D/PROGRA~1/MICROS~2/Include" CPPFLAGS="-fno-common -I/usr/local/include" LDFLAGS="-no-undefined -L/usr/local/lib" ./autogen.sh --enable-experimental --disable-gtk-doc --disable-amrwb --with-libintl-prefix=/mingw
make
make install

/mingw/include/mssdk is the place where you should put msacm.h and mmreg.h headers from your Windows Platform SDK (you can't include the whole SDK)

/D/PROGRA~1/MICROS~2/Include is the include directory of MS DirectX SDK (see gst-plugins-good page)

That's all for gst-plugins-bad. Plugins that were not built are: