[gst-devel] python gstreamer and windows

John Janecek nopa90 at gmail.com
Sun Nov 6 05:31:40 CET 2005


Managed to get the _gst extension to compile under windows, with mingw
Need help to get the interfaces extension to compile, I get all sorts
of nasty references to gobject (even though linked against it).

If anyone got any ideas how to make interfaces module compile i would
be happy :)

Anyway here is what i did

1) follow this http://gstreamer.xeris.cz/winport.html

The in the gst-python module generate the gst.c and interface.c files

In the gst.c file remove all references to libxml_xmlDocPtrWrap
(for some reason linker can not find that function)

My compiler complained about a static structure (just set it to 0) I
think it is a compiler error.

I use pymingw python which uses mscvt libs, if u use regular python
nasty will happen probably

Made a setup.py file
####setup.py
from distutils.core import setup
from distutils.extension import Extension
import sys
prefix = "C:/msys/1.0/local"

files = ["gst.c","gst-argtypes.c","gstmodule.c","pygstiterator.c","pygstminiobject.c","pygstobject.c","pygstvalue.c","pygstexception.c"]
define_macros=[("PYGST_MAJOR_VERSION","0"),("PYGST_MINOR_VERSION","9"),("PYGST_MICRO_VERSION","4")]
include_dirs=[	
				"C:/Python24/include/pygtk-2.0",
				prefix+"/include",
				prefix+"/include/glib-2.0",
				prefix+"/lib/glib-2.0/include", #glibconfig.h shoves there why ?
				prefix+"/include/gstreamer-0.9",
				prefix+"/include/libxml2"
				]
				
library_dirs = [prefix+"/lib"]
libraries = ["python24",
			"gobject-2.0",
			"glib-2.0",
			"gmodule-2.0",
			"libgstbase-0.9",
			"gstcontroller-0.9",
			"gstdataprotocol-0.9",
			"gstinterfaces-0.9",
			"gstreamer-0.9",
			"gthread-2.0"]

setup(name="gst",
      ext_modules=[
                    Extension("_gst",files,
                    define_macros=define_macros,
                    library_dirs=library_dirs,
                    libraries=libraries,
                    include_dirs=include_dirs,
                    depends=[]),
                    ]
     )
#### end file

When I try same for interfaces extension

from distutils.core import setup
from distutils.extension import Extension
import sys

prefix = "C:/msys/1.0/local"

files = ["interfacesmodule.c","interfaces.c"]
define_macros=[("PYGST_MAJOR_VERSION","0"),("PYGST_MINOR_VERSION","9"),("PYGST_MICRO_VERSION","4")]
include_dirs=[	
				"C:/Python24/include/pygtk-2.0",
				prefix+"/include",
				prefix+"/include/glib-2.0",
				prefix+"/lib/glib-2.0/include", #glibconfig.h shoves there why ?
				prefix+"/include/gstreamer-0.9",
				prefix+"/include/libxml2"
				]
				
library_dirs = [prefix+"/lib",prefix+"/lib/gstreamer-0.9"]
libraries = ["python24",
			"gobject-2.0",
			"glib-2.0",
			"gmodule-2.0",
			"gstbase-0.9",
			"gstcontroller-0.9",
			"gstdataprotocol-0.9",
			"gstinterfaces-0.9",
			"gstnet-0.9",
			"gstriff-0.9",
			"gstreamer-0.9",
			"gthread-2.0",
			]

setup(name="interfaces",
      ext_modules=[
                    Extension("interfaces",files,
                    define_macros=define_macros,
                    library_dirs=library_dirs,
                    libraries=libraries,
                    include_dirs=include_dirs,
                    depends=[]),
                    ]
     )

I can not get it to link (get lots of undefined references to things in glib)

If u remove from the __init__.py importing interfaces

and if u set ur plugin paths etc

the f2f.py example will work. Have not tried other examples (obviously
ones which require interfaces will not work)




More information about the gstreamer-devel mailing list