[vlc-devel] commit: python-ctypes: implement shortcut media.add_options ( in addition to the existing instance.media_new( mrl, 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 23 11:15:24 2009 +0100| [d2a714c1e4f5337e9d602dc7e81f875fc29e0305] | committer: Olivier Aubert 

python-ctypes: implement shortcut media.add_options (in addition to the existing instance.media_new( mrl, options...))

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

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

diff --git a/bindings/python-ctypes/override.py b/bindings/python-ctypes/override.py
index 9f9d6a8..8cf379e 100644
--- a/bindings/python-ctypes/override.py
+++ b/bindings/python-ctypes/override.py
@@ -168,6 +168,19 @@ class MediaControl:
         e=MediaControlException()
         return mediacontrol_get_stream_information(self, key, e).contents
 
+class Media:
+    def add_options(self, *list_of_options):
+        """Add a list of options to the media.
+
+        Options must be written without the double-dash, e.g.:
+        m.add_options('sub-filter=marq at test{marquee=Hello}', 'video-filter=invert')
+
+        Note that you also can directly pass these options in the Instance.media_new method:
+        m=instance.media_new( 'foo.avi', 'sub-filter=marq at test{marquee=Hello}', 'video-filter=invert')
+        """
+        for o in list_of_options:
+            self.add_option(o)
+
 class MediaPlayer:
     """Create a new MediaPlayer instance.
 




More information about the vlc-devel mailing list