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
19 vlcconfig=get_vlcconfig()
23 cflags=os.popen('%s --cflags' % vlcconfig, 'r').readline().rstrip().split()
27 vlcconfig=get_vlcconfig()
31 os.environ['top_builddir'] = '../..'
32 ldflags=os.popen('%s --libs vlc builtin' % vlcconfig, 'r').readline().rstrip().split()
35 # To compile in a local vlc tree
36 vlclocal = Extension('vlc',
37 sources = ['vlcglue.c',
38 '../../src/control/init.c'],
39 include_dirs = ['../../include', '../../', '/usr/win32/include' ],
40 extra_objects = [ '../../lib/libvlc.a' ],
41 extra_compile_args = get_cflags(),
42 extra_link_args = [ '-L../..' ] + get_ldflags(),
45 setup (name = 'MediaControl',
47 scripts = [ 'vlcdebug.py' ],
48 description = """VLC bindings for python.
50 This module provides a MediaControl object, which implements an API
51 inspired from the OMG Audio/Video Stream 1.0 specification. Moreover,
52 the module provides a Object type, which gives a low-level access to
53 the vlc objects and their variables.
58 mc=vlc.MediaControl(['--verbose', '1'])
59 mc.playlist_add_item('movie.mpg')
61 # Start the movie at 2000ms
63 p.origin=vlc.RelativePosition
67 # which could be abbreviated as
69 # for the default conversion from int is to make a RelativePosition in MediaTime
71 # Display some text during 2000ms
72 mc.display_text('Some useless information', 0, 2000)
77 # Get status information
78 mc.get_stream_information()
80 # Access lowlevel objets
83 i=o.find_object('input')
87 ext_modules = [ vlclocal ])