Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
4b8fd642
Commit
4b8fd642
authored
Aug 28, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-ctypes: accomodate both old and new message exception getter
parent
cb6d304e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
+35
-12
bindings/python-ctypes/header.py
bindings/python-ctypes/header.py
+35
-12
No files found.
bindings/python-ctypes/header.py
View file @
4b8fd642
...
...
@@ -91,19 +91,42 @@ class LibVLCException(Exception):
pass
# From libvlc_structures.h
class
VLCException
(
ctypes
.
Structure
):
"""libvlc exception.
"""
_fields_
=
[
(
'raised'
,
ctypes
.
c_int
),
(
'code'
,
ctypes
.
c_int
),
(
'message'
,
ctypes
.
c_char_p
),
]
def
init
(
self
):
libvlc_exception_init
(
self
)
def
clear
(
self
):
libvlc_exception_clear
(
self
)
# This is version-dependent, depending on the presence of libvlc_exception_get_message.
if
hasattr
(
dll
,
'libvlc_exception_get_message'
):
# New-style message passing
class
VLCException
(
ctypes
.
Structure
):
"""libvlc exception.
"""
_fields_
=
[
(
'raised'
,
ctypes
.
c_int
),
]
@
property
def
message
(
self
):
return
dll
.
libvlc_exception_get_message
()
def
init
(
self
):
libvlc_exception_init
(
self
)
def
clear
(
self
):
libvlc_exception_clear
(
self
)
else
:
# Old-style exceptions
class
VLCException
(
ctypes
.
Structure
):
"""libvlc exception.
"""
_fields_
=
[
(
'raised'
,
ctypes
.
c_int
),
(
'code'
,
ctypes
.
c_int
),
(
'message'
,
ctypes
.
c_char_p
),
]
def
init
(
self
):
libvlc_exception_init
(
self
)
def
clear
(
self
):
libvlc_exception_clear
(
self
)
class
PlaylistItem
(
ctypes
.
Structure
):
_fields_
=
[
...
...
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