[vlc-devel] commit: python-ctypes: override Instance. media_new to allow to directly pass item options (Olivier Aubert )

git version control git at videolan.org
Mon Nov 23 11:15:38 CET 2009


vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Mon Nov 16 17:57:01 2009 +0100| [c57811067847c2644c2487a749f149057fb448cf] | committer: Olivier Aubert 

python-ctypes: override Instance.media_new to allow to directly pass item options

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c57811067847c2644c2487a749f149057fb448cf
---

 bindings/python-ctypes/override.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/bindings/python-ctypes/override.py b/bindings/python-ctypes/override.py
index 2813ac1..9f9d6a8 100644
--- a/bindings/python-ctypes/override.py
+++ b/bindings/python-ctypes/override.py
@@ -51,6 +51,18 @@ class Instance:
         p._instance=self
         return p
 
+    def media_new(self, mrl, *options):
+        """Create an empty Media Player object
+
+        Options can be specified as supplementary string parameters, e.g.
+        m=i.media_new('foo.avi', 'sub-filter=marq{marquee=Hello}', 'vout-filter=invert')
+        """
+        e=VLCException()
+        m=libvlc_media_new(self, mrl, e)
+        for o in options:
+            libvlc_media_add_option(m, o, e)
+        return m
+
 class MediaControl:
     """Create a new MediaControl instance
 




More information about the vlc-devel mailing list