1 from distutils.core import setup, Extension
6 for n in ( 'vlc-config',
7 os.path.sep.join( ('..', '..', 'vlc-config' ))):
12 print "*** Warning *** Cannot find vlc-config"
13 elif os.sys.platform == 'win32':
14 # Win32 does not know how to invoke the shell itself.
15 vlcconfig="sh %s" % vlcconfig
18 def get_vlc_version():
19 vlcconfig=get_vlcconfig()
23 version=os.popen('%s --version' % vlcconfig, 'r').readline().strip()
27 vlcconfig=get_vlcconfig()
31 cflags=os.popen('%s --cflags' % vlcconfig, 'r').readline().rstrip().split()
35 vlcconfig=get_vlcconfig()
39 os.environ['top_builddir'] = '../..'
41 if os.sys.platform == 'darwin':
42 ldflags = "-read_only_relocs warning".split()
43 ldflags.extend(os.popen('%s --libs vlc pic builtin' % vlcconfig, 'r').readline().rstrip().split())
44 if os.sys.platform == 'darwin':
45 ldflags.append('-lstdc++')
48 # To compile in a local vlc tree
49 vlclocal = Extension('vlc',
50 sources = ['vlcglue.c',
51 '../../src/control/init.c'],
52 include_dirs = ['../../include', '../../', '/usr/win32/include' ],
53 extra_objects = [ '../../lib/libvlc_pic.a' ],
54 extra_compile_args = get_cflags(),
55 extra_link_args = [ '-L../..' ] + get_ldflags(),
58 setup (name = 'MediaControl',
59 version = get_vlc_version(),
60 scripts = [ 'vlcdebug.py' ],
61 keywords = [ 'vlc', 'video' ],
63 description = """VLC bindings for python.
65 This module provides a MediaControl object, which implements an API
66 inspired from the OMG Audio/Video Stream 1.0 specification. Moreover,
67 the module provides a Object type, which gives a low-level access to
68 the vlc objects and their variables.
70 Documentation can be found on the VLC wiki :
71 http://wiki.videolan.org/index.php/PythonBinding
76 mc=vlc.MediaControl(['--verbose', '1'])
77 mc.playlist_add_item('movie.mpg')
79 # Start the movie at 2000ms
81 p.origin=vlc.RelativePosition
85 # which could be abbreviated as
87 # for the default conversion from int is to make a RelativePosition in MediaTime
89 # Display some text during 2000ms
90 mc.display_text('Some useless information', 0, 2000)
95 # Get status information
96 mc.get_stream_information()
98 # Access lowlevel objets
101 i=o.find_object('input')
105 ext_modules = [ vlclocal ])