[vlc-devel] commit: python: remove deprecated methods (Olivier Aubert )

git version control git at videolan.org
Thu Jul 30 11:03:52 CEST 2009


vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Wed Jul 29 00:13:35 2009 +0200| [c3f185182f8ae1f02f5e04adfd705e1840a4dfe5] | committer: Olivier Aubert 

python: remove deprecated methods

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

 bindings/python/vlc_instance.c    |   54 ----------------
 bindings/python/vlc_mediaplayer.c |  126 ++++++++++++++++++++++++++-----------
 2 files changed, 88 insertions(+), 92 deletions(-)

diff --git a/bindings/python/vlc_instance.c b/bindings/python/vlc_instance.c
index f01b171..9bff899 100644
--- a/bindings/python/vlc_instance.c
+++ b/bindings/python/vlc_instance.c
@@ -138,54 +138,6 @@ vlcInstance_new_media_player( PyObject *self, PyObject *args )
 }
 
 static PyObject *
-vlcInstance_video_set_parent( PyObject *self, PyObject *args )
-{
-    libvlc_exception_t ex;
-    int i_drawable;
-
-    if( !PyArg_ParseTuple( args, "i", &i_drawable ) )
-        return NULL;
-
-    LIBVLC_TRY;
-    libvlc_video_set_parent( LIBVLC_INSTANCE(self), (libvlc_drawable_t) i_drawable, &ex );
-    LIBVLC_EXCEPT;
-
-    Py_INCREF( Py_None );
-    return Py_None;
-}
-
-static PyObject *
-vlcInstance_video_get_parent( PyObject *self, PyObject *args )
-{
-    libvlc_exception_t ex;
-    libvlc_drawable_t i_ret;
-
-    LIBVLC_TRY;
-    i_ret = libvlc_video_get_parent( LIBVLC_INSTANCE(self), &ex );
-    LIBVLC_EXCEPT;
-
-    return Py_BuildValue( "L", i_ret );
-}
-
-static PyObject *
-vlcInstance_video_set_size( PyObject *self, PyObject *args )
-{
-    libvlc_exception_t ex;
-    int i_width;
-    int i_height;
-
-    if( !PyArg_ParseTuple( args, "ii", &i_width, &i_height ) )
-        return NULL;
-
-    LIBVLC_TRY;
-    libvlc_video_set_size( LIBVLC_INSTANCE(self), i_width, i_height, &ex );
-    LIBVLC_EXCEPT;
-
-    Py_INCREF( Py_None );
-    return Py_None;
-}
-
-static PyObject *
 vlcInstance_audio_toggle_mute( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
@@ -564,12 +516,6 @@ static PyMethodDef vlcInstance_methods[] =
 {
     { "get_vlc_id", vlcInstance_get_vlc_id, METH_NOARGS,
       "get_vlc_id( ) -> int        Get the instance id."},
-    { "video_set_parent", vlcInstance_video_set_parent, METH_VARARGS,
-      "video_set_parent(xid=int)       Set the parent xid/HWND/CGrafPort"},
-    { "video_get_parent", vlcInstance_video_get_parent, METH_NOARGS,
-      "video_get_parent() -> int       Get the parent xid/HWND/CGrafPort"},
-    { "video_set_size", vlcInstance_video_set_size, METH_VARARGS,
-      "video_set_size(width=int, height=int)    Set the video width and height"},
     { "audio_toggle_mute", vlcInstance_audio_toggle_mute, METH_NOARGS,
       "audio_toggle_mute()         Toggle the mute state"},
     { "audio_get_mute", vlcInstance_audio_get_mute, METH_NOARGS,
diff --git a/bindings/python/vlc_mediaplayer.c b/bindings/python/vlc_mediaplayer.c
index 880326c..fa291fa 100644
--- a/bindings/python/vlc_mediaplayer.c
+++ b/bindings/python/vlc_mediaplayer.c
@@ -344,107 +344,126 @@ vlcMediaPlayer_video_take_snapshot( PyObject *self, PyObject *args )
 }
 
 static PyObject *
-vlcMediaPlayer_video_resize( PyObject *self, PyObject *args )
+vlcMediaPlayer_is_seekable( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
-    int i_width;
-    int i_height;
-
-    if( !PyArg_ParseTuple( args, "ii", &i_width, &i_height ) )
-        return NULL;
-
+    int i_ret;
     LIBVLC_TRY;
-    libvlc_video_resize( LIBVLC_MEDIAPLAYER(self), i_width, i_height, &ex);
+    i_ret = libvlc_media_player_is_seekable( LIBVLC_MEDIAPLAYER(self), &ex);
     LIBVLC_EXCEPT;
-    Py_INCREF( Py_None );
-    return Py_None;
+    return Py_BuildValue( "i", i_ret );
 }
 
 static PyObject *
-vlcMediaPlayer_video_reparent( PyObject *self, PyObject *args )
+vlcMediaPlayer_can_pause( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
-    WINDOWHANDLE i_visual;
     int i_ret;
-
-    if( !PyArg_ParseTuple( args, "i", &i_visual ) )
-        return NULL;
-
     LIBVLC_TRY;
-    i_ret = libvlc_video_reparent( LIBVLC_MEDIAPLAYER(self), i_visual, &ex);
+    i_ret = libvlc_media_player_can_pause( LIBVLC_MEDIAPLAYER(self), &ex);
     LIBVLC_EXCEPT;
     return Py_BuildValue( "i", i_ret );
 }
 
 static PyObject *
-vlcMediaPlayer_is_seekable( PyObject *self, PyObject *args )
+vlcMediaPlayer_play( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
-    int i_ret;
+
     LIBVLC_TRY;
-    i_ret = libvlc_media_player_is_seekable( LIBVLC_MEDIAPLAYER(self), &ex);
+    libvlc_media_player_play( LIBVLC_MEDIAPLAYER(self), &ex);
     LIBVLC_EXCEPT;
-    return Py_BuildValue( "i", i_ret );
+    Py_INCREF( Py_None );
+    return Py_None;
 }
 
 static PyObject *
-vlcMediaPlayer_can_pause( PyObject *self, PyObject *args )
+vlcMediaPlayer_pause( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
-    int i_ret;
+
     LIBVLC_TRY;
-    i_ret = libvlc_media_player_can_pause( LIBVLC_MEDIAPLAYER(self), &ex);
+    libvlc_media_player_pause( LIBVLC_MEDIAPLAYER(self), &ex);
     LIBVLC_EXCEPT;
-    return Py_BuildValue( "i", i_ret );
+    Py_INCREF( Py_None );
+    return Py_None;
 }
 
 static PyObject *
-vlcMediaPlayer_play( PyObject *self, PyObject *args )
+vlcMediaPlayer_stop( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
 
     LIBVLC_TRY;
-    libvlc_media_player_play( LIBVLC_MEDIAPLAYER(self), &ex);
+    libvlc_media_player_stop( LIBVLC_MEDIAPLAYER(self), &ex);
     LIBVLC_EXCEPT;
     Py_INCREF( Py_None );
     return Py_None;
 }
 
 static PyObject *
-vlcMediaPlayer_pause( PyObject *self, PyObject *args )
+vlcMediaPlayer_set_xwindow( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
+    uint32_t i_drawable;
+
+    if( !PyArg_ParseTuple( args, "i", &i_drawable ) )
+        return NULL;
 
     LIBVLC_TRY;
-    libvlc_media_player_pause( LIBVLC_MEDIAPLAYER(self), &ex);
+    libvlc_media_player_set_xwindow( LIBVLC_MEDIAPLAYER(self), i_drawable, &ex );
     LIBVLC_EXCEPT;
+
     Py_INCREF( Py_None );
     return Py_None;
 }
 
 static PyObject *
-vlcMediaPlayer_stop( PyObject *self, PyObject *args )
+vlcMediaPlayer_get_xwindow( PyObject *self, PyObject *args )
+{
+    uint32_t i_ret;
+
+    i_ret = libvlc_media_player_get_xwindow( LIBVLC_MEDIAPLAYER(self));
+    return Py_BuildValue( "i", i_ret );
+}
+
+static PyObject *
+vlcMediaPlayer_set_hwnd( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
+    void* i_drawable;
+
+    if( !PyArg_ParseTuple( args, "l", &i_drawable ) )
+        return NULL;
 
     LIBVLC_TRY;
-    libvlc_media_player_stop( LIBVLC_MEDIAPLAYER(self), &ex);
+    libvlc_media_player_set_hwnd( LIBVLC_MEDIAPLAYER(self), (void*) i_drawable, &ex );
     LIBVLC_EXCEPT;
+
     Py_INCREF( Py_None );
     return Py_None;
 }
 
 static PyObject *
-vlcMediaPlayer_set_drawable( PyObject *self, PyObject *args )
+vlcMediaPlayer_get_hwnd( PyObject *self, PyObject *args )
+{
+    void* i_ret;
+
+    i_ret = libvlc_media_player_get_hwnd( LIBVLC_MEDIAPLAYER(self));
+    return Py_BuildValue( "l", i_ret );
+}
+
+static PyObject *
+vlcMediaPlayer_set_agl( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
-    int i_drawable;
+    uint32_t i_drawable;
 
     if( !PyArg_ParseTuple( args, "i", &i_drawable ) )
         return NULL;
 
     LIBVLC_TRY;
-    libvlc_media_player_set_drawable( LIBVLC_MEDIAPLAYER(self), (libvlc_drawable_t) i_drawable, &ex );
+    libvlc_media_player_set_agl( LIBVLC_MEDIAPLAYER(self), i_drawable, &ex );
     LIBVLC_EXCEPT;
 
     Py_INCREF( Py_None );
@@ -452,6 +471,41 @@ vlcMediaPlayer_set_drawable( PyObject *self, PyObject *args )
 }
 
 static PyObject *
+vlcMediaPlayer_get_agl( PyObject *self, PyObject *args )
+{
+    uint32_t i_ret;
+
+    i_ret = libvlc_media_player_get_agl( LIBVLC_MEDIAPLAYER(self));
+    return Py_BuildValue( "i", i_ret );
+}
+
+static PyObject *
+vlcMediaPlayer_set_nsobject( PyObject *self, PyObject *args )
+{
+    libvlc_exception_t ex;
+    void* i_drawable;
+
+    if( !PyArg_ParseTuple( args, "l", &i_drawable ) )
+        return NULL;
+
+    LIBVLC_TRY;
+    libvlc_media_player_set_nsobject( LIBVLC_MEDIAPLAYER(self), (void*) i_drawable, &ex );
+    LIBVLC_EXCEPT;
+
+    Py_INCREF( Py_None );
+    return Py_None;
+}
+
+static PyObject *
+vlcMediaPlayer_get_hwnd( PyObject *self, PyObject *args )
+{
+    void* i_ret;
+
+    i_ret = libvlc_media_player_get_nsobject( LIBVLC_MEDIAPLAYER(self));
+    return Py_BuildValue( "l", i_ret );
+}
+
+static PyObject *
 vlcMediaPlayer_set_media( PyObject *self, PyObject *args )
 {
     libvlc_exception_t ex;
@@ -575,10 +629,6 @@ static PyMethodDef vlcMediaPlayer_methods[] =
       "set_aspect_ratio(str)        Set new video aspect ratio" },
     { "video_take_snapshot", vlcMediaPlayer_video_take_snapshot, METH_VARARGS,
       "video_take_snapshot(filename=str)        Take a snapshot of the current video window" },
-    { "video_resize", vlcMediaPlayer_video_resize, METH_VARARGS,
-      "video_resize(width=int, height=int)      Resize the current video output window" },
-    { "video_reparent", vlcMediaPlayer_video_reparent, METH_VARARGS,
-      "video_reparent(visual=int)               change the parent for the current video output" },
 
     { "play", vlcMediaPlayer_play, METH_VARARGS,
       "play()    Play the media instance" },




More information about the vlc-devel mailing list