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', '../../src/control/init.c'],
38 include_dirs = ['../../include', '../../', '/usr/win32/include' ],
39 extra_objects = [ '../../lib/libvlc.a' ],
40 extra_compile_args = get_cflags(),
41 extra_link_args = [ '-L../..' ] + get_ldflags(),
44 setup (name = 'MediaControl',
46 scripts = [ 'vlcdebug.py' ],
47 description = """VLC bindings for python.
49 This module provides a MediaControl object, which implements an API
50 inspired from the OMG Audio/Video Stream 1.0 specification. Moreover,
51 the module provides a Object type, which gives a low-level access to
52 the vlc objects and their variables.
57 mc=vlc.MediaControl(['--verbose', '1'])
58 mc.playlist_add_item('movie.mpg')
60 # Start the movie at 2000ms
62 p.origin=vlc.RelativePosition
66 # which could be abbreviated as
68 # for the default conversion from int is to make a RelativePosition in MediaTime
70 # Display some text during 2000ms
71 mc.display_text('Some useless information', 0, 2000)
76 # Get status information
77 mc.get_stream_information()
79 # Access lowlevel objets
82 i=o.find_object('input')
86 ext_modules = [ vlclocal ])