/*****************************************************************************
* vlc_mediaplayer.c: vlc.MediaPlayer binding
*****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006,2007,2008,2009 the VideoLAN team
* $Id$
*
- * Authors: Olivier Aubert <oaubert at bat710.univ-lyon1.fr>
+ * Authors: Olivier Aubert <olivier.aubert at liris.cnrs.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
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 );
return Py_None;
}
+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_nsobject( 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 )
{
"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" },
"pause() Pause the media instance" },
{ "stop", vlcMediaPlayer_stop, METH_VARARGS,
"stop() Stop the media instance" },
- { "set_drawable", vlcMediaPlayer_set_drawable, METH_VARARGS,
- "set_drawable() Set the drawable id" },
+
+ { "set_xwindow", vlcMediaPlayer_set_xwindow, METH_VARARGS,
+ "set_xwindow() Set the X-Window id" },
+ { "set_nsobject", vlcMediaPlayer_set_nsobject, METH_VARARGS,
+ "set_nsobject() Set the NSObject" },
+ { "set_agl", vlcMediaPlayer_set_agl, METH_VARARGS,
+ "set_agl() Set the AGL" },
+ { "set_hwnd", vlcMediaPlayer_set_hwnd, METH_VARARGS,
+ "set_hwndl() Set the HWND" },
+
+ { "get_xwindow", vlcMediaPlayer_get_xwindow, METH_VARARGS,
+ "get_xwindow() Set the X-Window id" },
+ { "get_nsobject", vlcMediaPlayer_get_nsobject, METH_VARARGS,
+ "get_nsobject() Set the NSObject" },
+ { "get_agl", vlcMediaPlayer_get_agl, METH_VARARGS,
+ "get_agl() Set the AGL" },
+ { "get_hwnd", vlcMediaPlayer_get_hwnd, METH_VARARGS,
+ "get_hwndl() Set the HWND" },
{ "get_chapter", vlcMediaPlayer_get_chapter, METH_VARARGS,
"get_chapter() -> int Get current chapter" },