Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
b1def0f0
Commit
b1def0f0
authored
Mar 02, 2009
by
JP Dinger
Committed by
Olivier Aubert
Mar 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parametrize macros, and pack up deref that happens anyway.
Signed-off-by:
Olivier Aubert
<
olivier.aubert@liris.cnrs.fr
>
parent
54d22477
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
77 deletions
+75
-77
bindings/python/vlc_instance.c
bindings/python/vlc_instance.c
+28
-28
bindings/python/vlc_media.c
bindings/python/vlc_media.c
+8
-8
bindings/python/vlc_mediaplayer.c
bindings/python/vlc_mediaplayer.c
+36
-36
bindings/python/vlcglue.h
bindings/python/vlcglue.h
+3
-5
No files found.
bindings/python/vlc_instance.c
View file @
b1def0f0
...
...
@@ -98,7 +98,7 @@ vlcInstance_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
Py_BEGIN_ALLOW_THREADS
LIBVLC_TRY
LIBVLC_INSTANCE
->
p_instance
=
libvlc_new
(
i_size
,
ppsz_args
,
&
ex
);
LIBVLC_INSTANCE
(
self
)
=
libvlc_new
(
i_size
,
ppsz_args
,
&
ex
);
free_args
(
i_size
,
ppsz_args
);
LIBVLC_EXCEPT
Py_END_ALLOW_THREADS
...
...
@@ -110,14 +110,14 @@ vlcInstance_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
static
void
vlcInstance_dealloc
(
PyObject
*
self
)
{
libvlc_release
(
LIBVLC_INSTANCE
->
p_instance
);
libvlc_release
(
LIBVLC_INSTANCE
(
self
)
);
PyObject_DEL
(
self
);
}
static
PyObject
*
vlcInstance_get_vlc_id
(
PyObject
*
self
,
PyObject
*
args
)
{
return
Py_BuildValue
(
"i"
,
libvlc_get_vlc_id
(
LIBVLC_INSTANCE
->
p_instance
)
);
return
Py_BuildValue
(
"i"
,
libvlc_get_vlc_id
(
LIBVLC_INSTANCE
(
self
)
)
);
}
static
PyObject
*
...
...
@@ -128,7 +128,7 @@ vlcInstance_new_media_player( PyObject *self, PyObject *args )
vlcMediaPlayer
*
p_ret
;
LIBVLC_TRY
;
p_mp
=
libvlc_media_player_new
(
LIBVLC_INSTANCE
->
p_instance
,
&
ex
);
p_mp
=
libvlc_media_player_new
(
LIBVLC_INSTANCE
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
p_ret
=
PyObject_New
(
vlcMediaPlayer
,
&
vlcMediaPlayer_Type
);
...
...
@@ -147,7 +147,7 @@ vlcInstance_video_set_parent( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_video_set_parent
(
LIBVLC_INSTANCE
->
p_instance
,
(
libvlc_drawable_t
)
i_drawable
,
&
ex
);
libvlc_video_set_parent
(
LIBVLC_INSTANCE
(
self
)
,
(
libvlc_drawable_t
)
i_drawable
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
...
...
@@ -161,7 +161,7 @@ vlcInstance_video_get_parent( PyObject *self, PyObject *args )
libvlc_drawable_t
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_video_get_parent
(
LIBVLC_INSTANCE
->
p_instance
,
&
ex
);
i_ret
=
libvlc_video_get_parent
(
LIBVLC_INSTANCE
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"L"
,
i_ret
);
...
...
@@ -178,7 +178,7 @@ vlcInstance_video_set_size( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_video_set_size
(
LIBVLC_INSTANCE
->
p_instance
,
i_width
,
i_height
,
&
ex
);
libvlc_video_set_size
(
LIBVLC_INSTANCE
(
self
)
,
i_width
,
i_height
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
...
...
@@ -190,7 +190,7 @@ vlcInstance_audio_toggle_mute( PyObject *self, PyObject *args )
{
libvlc_exception_t
ex
;
LIBVLC_TRY
;
libvlc_audio_toggle_mute
(
LIBVLC_INSTANCE
->
p_instance
,
&
ex
);
libvlc_audio_toggle_mute
(
LIBVLC_INSTANCE
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -203,7 +203,7 @@ vlcInstance_audio_get_mute( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_audio_get_mute
(
LIBVLC_INSTANCE
->
p_instance
,
&
ex
);
i_ret
=
libvlc_audio_get_mute
(
LIBVLC_INSTANCE
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -218,7 +218,7 @@ vlcInstance_audio_set_mute( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_audio_set_mute
(
LIBVLC_INSTANCE
->
p_instance
,
i_mute
,
&
ex
);
libvlc_audio_set_mute
(
LIBVLC_INSTANCE
(
self
)
,
i_mute
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -231,7 +231,7 @@ vlcInstance_audio_get_volume( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_audio_get_volume
(
LIBVLC_INSTANCE
->
p_instance
,
&
ex
);
i_ret
=
libvlc_audio_get_volume
(
LIBVLC_INSTANCE
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -246,7 +246,7 @@ vlcInstance_audio_set_volume( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_audio_set_volume
(
LIBVLC_INSTANCE
->
p_instance
,
i_volume
,
&
ex
);
libvlc_audio_set_volume
(
LIBVLC_INSTANCE
(
self
)
,
i_volume
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -259,7 +259,7 @@ vlcInstance_audio_get_channel( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_audio_get_channel
(
LIBVLC_INSTANCE
->
p_instance
,
&
ex
);
i_ret
=
libvlc_audio_get_channel
(
LIBVLC_INSTANCE
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -274,7 +274,7 @@ vlcInstance_audio_set_channel( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_audio_set_channel
(
LIBVLC_INSTANCE
->
p_instance
,
i_channel
,
&
ex
);
libvlc_audio_set_channel
(
LIBVLC_INSTANCE
(
self
)
,
i_channel
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -309,7 +309,7 @@ vlcInstance_vlm_add_broadcast( PyObject *self, PyObject *args, PyObject *kwds )
}
LIBVLC_TRY
;
libvlc_vlm_add_broadcast
(
LIBVLC_INSTANCE
->
p_instance
,
libvlc_vlm_add_broadcast
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
psz_input
,
psz_output
,
i_size
,
ppsz_args
,
i_enable
,
i_loop
,
&
ex
);
free_args
(
i_size
,
ppsz_args
);
...
...
@@ -328,7 +328,7 @@ vlcInstance_vlm_del_media( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_del_media
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
&
ex
);
libvlc_vlm_del_media
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -345,7 +345,7 @@ vlcInstance_vlm_set_enabled( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_set_enabled
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
i_enabled
,
&
ex
);
libvlc_vlm_set_enabled
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
i_enabled
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -362,7 +362,7 @@ vlcInstance_vlm_set_output( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_set_output
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
psz_output
,
&
ex
);
libvlc_vlm_set_output
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
psz_output
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -379,7 +379,7 @@ vlcInstance_vlm_set_input( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_set_input
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
psz_input
,
&
ex
);
libvlc_vlm_set_input
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
psz_input
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -396,7 +396,7 @@ vlcInstance_vlm_add_input( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_add_input
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
psz_input
,
&
ex
);
libvlc_vlm_add_input
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
psz_input
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -413,7 +413,7 @@ vlcInstance_vlm_set_loop( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_set_loop
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
i_loop
,
&
ex
);
libvlc_vlm_set_loop
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
i_loop
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -446,7 +446,7 @@ vlcInstance_vlm_change_media( PyObject *self, PyObject *args, PyObject *kwds )
}
LIBVLC_TRY
;
libvlc_vlm_change_media
(
LIBVLC_INSTANCE
->
p_instance
,
libvlc_vlm_change_media
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
psz_input
,
psz_output
,
i_size
,
ppsz_args
,
i_enable
,
i_loop
,
&
ex
);
free_args
(
i_size
,
ppsz_args
);
...
...
@@ -465,7 +465,7 @@ vlcInstance_vlm_play_media( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_play_media
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
&
ex
);
libvlc_vlm_play_media
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -481,7 +481,7 @@ vlcInstance_vlm_stop_media( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_stop_media
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
&
ex
);
libvlc_vlm_stop_media
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -497,7 +497,7 @@ vlcInstance_vlm_pause_media( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_pause_media
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
&
ex
);
libvlc_vlm_pause_media
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -514,7 +514,7 @@ vlcInstance_vlm_seek_media( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_vlm_seek_media
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
f_percentage
,
&
ex
);
libvlc_vlm_seek_media
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
f_percentage
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -531,7 +531,7 @@ vlcInstance_vlm_show_media( PyObject *self, PyObject *args )
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
psz_name
)
)
return
NULL
;
LIBVLC_TRY
;
psz_ret
=
libvlc_vlm_show_media
(
LIBVLC_INSTANCE
->
p_instance
,
psz_name
,
&
ex
);
psz_ret
=
libvlc_vlm_show_media
(
LIBVLC_INSTANCE
(
self
)
,
psz_name
,
&
ex
);
LIBVLC_EXCEPT
;
o_ret
=
Py_BuildValue
(
"s"
,
psz_ret
);
free
(
psz_ret
);
...
...
@@ -550,7 +550,7 @@ vlcInstance_media_new( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
p_media
=
libvlc_media_new
(
LIBVLC_INSTANCE
->
p_instance
,
psz_mrl
,
&
ex
);
p_media
=
libvlc_media_new
(
LIBVLC_INSTANCE
(
self
)
,
psz_mrl
,
&
ex
);
LIBVLC_EXCEPT
;
p_ret
=
PyObject_New
(
vlcMedia
,
&
vlcMedia_Type
);
...
...
bindings/python/vlc_media.c
View file @
b1def0f0
...
...
@@ -37,7 +37,7 @@ vlcMedia_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
static
void
vlcMedia_dealloc
(
PyObject
*
self
)
{
libvlc_media_release
(
LIBVLC_MEDIA
->
p_media
);
libvlc_media_release
(
LIBVLC_MEDIA
(
self
)
);
PyObject_DEL
(
self
);
}
...
...
@@ -51,7 +51,7 @@ vlcMedia_add_option( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_media_add_option
(
LIBVLC_MEDIA
->
p_media
,
psz_options
,
&
ex
);
libvlc_media_add_option
(
LIBVLC_MEDIA
(
self
)
,
psz_options
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -65,7 +65,7 @@ vlcMedia_get_mrl( PyObject *self, PyObject *args )
PyObject
*
o_ret
;
LIBVLC_TRY
;
psz_mrl
=
libvlc_media_get_mrl
(
LIBVLC_MEDIA
->
p_media
,
&
ex
);
psz_mrl
=
libvlc_media_get_mrl
(
LIBVLC_MEDIA
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
o_ret
=
Py_BuildValue
(
"s"
,
psz_mrl
);
...
...
@@ -80,7 +80,7 @@ vlcMedia_get_state( PyObject *self, PyObject *args )
libvlc_state_t
i_state
;
LIBVLC_TRY
;
i_state
=
libvlc_media_get_state
(
LIBVLC_MEDIA
->
p_media
,
&
ex
);
i_state
=
libvlc_media_get_state
(
LIBVLC_MEDIA
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
/* FIXME: return the defined state constant */
return
Py_BuildValue
(
"i"
,
i_state
);
...
...
@@ -92,7 +92,7 @@ vlcMedia_get_duration( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
libvlc_time_t
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_get_duration
(
LIBVLC_MEDIA
->
p_media
,
&
ex
);
i_ret
=
libvlc_media_get_duration
(
LIBVLC_MEDIA
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"L"
,
i_ret
);
}
...
...
@@ -105,7 +105,7 @@ vlcMedia_media_player_new( PyObject *self, PyObject *args )
vlcMediaPlayer
*
p_ret
;
LIBVLC_TRY
;
p_mp
=
libvlc_media_player_new_from_media
(
LIBVLC_MEDIA
->
p_media
,
&
ex
);
p_mp
=
libvlc_media_player_new_from_media
(
LIBVLC_MEDIA
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
p_ret
=
PyObject_New
(
vlcMediaPlayer
,
&
vlcMediaPlayer_Type
);
...
...
@@ -120,7 +120,7 @@ vlcMedia_is_preparsed( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_is_preparsed
(
LIBVLC_MEDIA
->
p_media
,
&
ex
);
i_ret
=
libvlc_media_is_preparsed
(
LIBVLC_MEDIA
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"L"
,
i_ret
);
}
...
...
@@ -155,7 +155,7 @@ vlcMedia_get_meta( PyObject *self, PyObject *args )
}
LIBVLC_TRY
;
psz_ret
=
libvlc_media_get_meta
(
LIBVLC_MEDIA
->
p_media
,
i_index
,
&
ex
);
psz_ret
=
libvlc_media_get_meta
(
LIBVLC_MEDIA
(
self
)
,
i_index
,
&
ex
);
LIBVLC_EXCEPT
;
o_ret
=
Py_BuildValue
(
"s"
,
psz_ret
);
...
...
bindings/python/vlc_mediaplayer.c
View file @
b1def0f0
...
...
@@ -32,7 +32,7 @@ vlcMediaPlayer_get_length( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int64_t
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_get_length
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_get_length
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"L"
,
i_ret
);
}
...
...
@@ -43,7 +43,7 @@ vlcMediaPlayer_get_time( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int64_t
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_get_time
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_get_time
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"L"
,
i_ret
);
}
...
...
@@ -58,7 +58,7 @@ vlcMediaPlayer_set_time( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_media_player_set_time
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
i_time
,
&
ex
);
libvlc_media_player_set_time
(
LIBVLC_MEDIAPLAYER
(
self
)
,
i_time
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -70,7 +70,7 @@ vlcMediaPlayer_get_position( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
float
f_ret
;
LIBVLC_TRY
;
f_ret
=
libvlc_media_player_get_position
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
f_ret
=
libvlc_media_player_get_position
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"f"
,
f_ret
);
}
...
...
@@ -85,7 +85,7 @@ vlcMediaPlayer_set_position( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_media_player_set_position
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
f_pos
,
&
ex
);
libvlc_media_player_set_position
(
LIBVLC_MEDIAPLAYER
(
self
)
,
f_pos
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -97,7 +97,7 @@ vlcMediaPlayer_will_play( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_will_play
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_will_play
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -108,7 +108,7 @@ vlcMediaPlayer_get_rate( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
float
f_ret
;
LIBVLC_TRY
;
f_ret
=
libvlc_media_player_get_rate
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
f_ret
=
libvlc_media_player_get_rate
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"f"
,
f_ret
);
}
...
...
@@ -123,7 +123,7 @@ vlcMediaPlayer_set_rate( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_media_player_set_rate
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
f_rate
,
&
ex
);
libvlc_media_player_set_rate
(
LIBVLC_MEDIAPLAYER
(
self
)
,
f_rate
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -135,7 +135,7 @@ vlcMediaPlayer_get_state( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_get_state
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_get_state
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -146,7 +146,7 @@ vlcMediaPlayer_has_vout( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_has_vout
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_has_vout
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -157,7 +157,7 @@ vlcMediaPlayer_get_fps( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
float
f_ret
;
LIBVLC_TRY
;
f_ret
=
libvlc_media_player_get_fps
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
f_ret
=
libvlc_media_player_get_fps
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"f"
,
f_ret
);
}
...
...
@@ -169,7 +169,7 @@ vlcMediaPlayer_audio_get_track( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_audio_get_track
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_audio_get_track
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -184,7 +184,7 @@ vlcMediaPlayer_audio_set_track( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_audio_set_track
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
i_track
,
&
ex
);
libvlc_audio_set_track
(
LIBVLC_MEDIAPLAYER
(
self
)
,
i_track
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -197,7 +197,7 @@ vlcMediaPlayer_get_chapter( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_get_chapter
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_get_chapter
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -209,7 +209,7 @@ vlcMediaPlayer_get_chapter_count( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_get_chapter_count
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_get_chapter_count
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -224,7 +224,7 @@ vlcMediaPlayer_set_chapter( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_media_player_set_chapter
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
i_chapter
,
&
ex
);
libvlc_media_player_set_chapter
(
LIBVLC_MEDIAPLAYER
(
self
)
,
i_chapter
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -237,7 +237,7 @@ vlcMediaPlayer_toggle_fullscreen( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
LIBVLC_TRY
;
libvlc_toggle_fullscreen
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
libvlc_toggle_fullscreen
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -253,7 +253,7 @@ vlcMediaPlayer_set_fullscreen( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_set_fullscreen
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
i_fullscreen
,
&
ex
);
libvlc_set_fullscreen
(
LIBVLC_MEDIAPLAYER
(
self
)
,
i_fullscreen
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -266,7 +266,7 @@ vlcMediaPlayer_get_fullscreen( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_get_fullscreen
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_get_fullscreen
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -278,7 +278,7 @@ vlcMediaPlayer_get_height( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_video_get_height
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_video_get_height
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -290,7 +290,7 @@ vlcMediaPlayer_get_width( PyObject *self, PyObject *args )
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_video_get_width
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_video_get_width
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -303,7 +303,7 @@ vlcMediaPlayer_get_aspect_ratio( PyObject *self, PyObject *args )
PyObject
*
o_ret
;
LIBVLC_TRY
;
psz_ret
=
libvlc_video_get_aspect_ratio
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
psz_ret
=
libvlc_video_get_aspect_ratio
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
o_ret
=
Py_BuildValue
(
"s"
,
psz_ret
);
free
(
psz_ret
);
...
...
@@ -320,7 +320,7 @@ vlcMediaPlayer_set_aspect_ratio( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_video_set_aspect_ratio
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
psz_ratio
,
&
ex
);
libvlc_video_set_aspect_ratio
(
LIBVLC_MEDIAPLAYER
(
self
)
,
psz_ratio
,
&
ex
);
LIBVLC_EXCEPT
;
free
(
psz_ratio
);
Py_INCREF
(
Py_None
);
...
...
@@ -337,7 +337,7 @@ vlcMediaPlayer_video_take_snapshot( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_video_take_snapshot
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
psz_filename
,
0
,
0
,
&
ex
);
libvlc_video_take_snapshot
(
LIBVLC_MEDIAPLAYER
(
self
)
,
psz_filename
,
0
,
0
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -354,7 +354,7 @@ vlcMediaPlayer_video_resize( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_video_resize
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
i_width
,
i_height
,
&
ex
);
libvlc_video_resize
(
LIBVLC_MEDIAPLAYER
(
self
)
,
i_width
,
i_height
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -371,7 +371,7 @@ vlcMediaPlayer_video_reparent( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
i_ret
=
libvlc_video_reparent
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
i_visual
,
&
ex
);
i_ret
=
libvlc_video_reparent
(
LIBVLC_MEDIAPLAYER
(
self
)
,
i_visual
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -382,7 +382,7 @@ vlcMediaPlayer_is_seekable( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_is_seekable
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_is_seekable
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -393,7 +393,7 @@ vlcMediaPlayer_can_pause( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_media_player_can_pause
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_media_player_can_pause
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -404,7 +404,7 @@ vlcMediaPlayer_play( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
LIBVLC_TRY
;
libvlc_media_player_play
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
libvlc_media_player_play
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -416,7 +416,7 @@ vlcMediaPlayer_pause( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
LIBVLC_TRY
;
libvlc_media_player_pause
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
libvlc_media_player_pause
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -428,7 +428,7 @@ vlcMediaPlayer_stop( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
LIBVLC_TRY
;
libvlc_media_player_stop
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
libvlc_media_player_stop
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -444,7 +444,7 @@ vlcMediaPlayer_set_drawable( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_media_player_set_drawable
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
(
libvlc_drawable_t
)
i_drawable
,
&
ex
);
libvlc_media_player_set_drawable
(
LIBVLC_MEDIAPLAYER
(
self
)
,
(
libvlc_drawable_t
)
i_drawable
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
...
...
@@ -462,7 +462,7 @@ vlcMediaPlayer_set_media( PyObject *self, PyObject *args )
if
(
PyObject_TypeCheck
(
py_param
,
&
vlcMedia_Type
)
==
1
)
{
LIBVLC_TRY
;
libvlc_media_player_set_media
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
((
vlcMedia
*
)
py_param
)
->
p_media
,
&
ex
);
libvlc_media_player_set_media
(
LIBVLC_MEDIAPLAYER
(
self
)
,
((
vlcMedia
*
)
py_param
)
->
p_media
,
&
ex
);
LIBVLC_EXCEPT
;
}
else
...
...
@@ -482,7 +482,7 @@ vlcMediaPlayer_get_media( PyObject *self, PyObject *args )
vlcMedia
*
p_ret
;
LIBVLC_TRY
;
p_media
=
libvlc_media_player_get_media
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
p_media
=
libvlc_media_player_get_media
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
if
(
!
p_media
)
...
...
@@ -505,7 +505,7 @@ vlcMediaPlayer_get_spu( PyObject *self, PyObject *args )
libvlc_exception_t
ex
;
int
i_ret
;
LIBVLC_TRY
;
i_ret
=
libvlc_video_get_spu
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
&
ex
);
i_ret
=
libvlc_video_get_spu
(
LIBVLC_MEDIAPLAYER
(
self
)
,
&
ex
);
LIBVLC_EXCEPT
;
return
Py_BuildValue
(
"i"
,
i_ret
);
}
...
...
@@ -520,7 +520,7 @@ vlcMediaPlayer_set_spu( PyObject *self, PyObject *args )
return
NULL
;
LIBVLC_TRY
;
libvlc_video_set_spu
(
LIBVLC_MEDIAPLAYER
->
p_mp
,
i_spu
,
&
ex
);
libvlc_video_set_spu
(
LIBVLC_MEDIAPLAYER
(
self
)
,
i_spu
,
&
ex
);
LIBVLC_EXCEPT
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
bindings/python/vlcglue.h
View file @
b1def0f0
...
...
@@ -89,8 +89,6 @@ typedef struct
libvlc_instance_t
*
p_instance
;
}
vlcInstance
;
#define LIBVLC_INSTANCE ((vlcInstance*)self)
/**********************************************************************
* MediaControl Object
**********************************************************************/
...
...
@@ -137,9 +135,9 @@ staticforward PyTypeObject vlcInstance_Type;
staticforward
PyTypeObject
vlcMediaPlayer_Type
;
staticforward
PyTypeObject
vlcMedia_Type
;
#define LIBVLC_INSTANCE
((vlcInstance*)self
)
#define LIBVLC_MEDIAPLAYER
((vlcMediaPlayer*)self
)
#define LIBVLC_MEDIA
((vlcMedia*)self
)
#define LIBVLC_INSTANCE
(self) (((vlcInstance*)self)->p_instance
)
#define LIBVLC_MEDIAPLAYER
(self) (((vlcMediaPlayer*)self)->p_mp
)
#define LIBVLC_MEDIA
(self) (((vlcMedia*)self)->p_media
)
#define LIBVLC_TRY libvlc_exception_init( &ex );
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment