Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
07aea022
Commit
07aea022
authored
Aug 04, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-ctypes: improve win32 support
parent
b25a3bb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
bindings/python-ctypes/footer.py
bindings/python-ctypes/footer.py
+5
-1
bindings/python-ctypes/header.py
bindings/python-ctypes/header.py
+15
-1
No files found.
bindings/python-ctypes/footer.py
View file @
07aea022
...
...
@@ -66,7 +66,10 @@ if __name__ == '__main__':
sys
.
exit
(
0
)
if
sys
.
argv
[
1
:]:
i
=
Instance
()
if
sys
.
platform
==
'win32'
and
plugin_path
is
not
None
:
i
=
Instance
(
'--plugin-path'
,
plugin_path
)
else
:
i
=
Instance
()
m
=
i
.
media_new
(
sys
.
argv
[
1
])
p
=
i
.
media_player_new
()
p
.
set_media
(
m
)
...
...
@@ -111,6 +114,7 @@ if __name__ == '__main__':
'q'
:
quit
,
}
print
"Press q to quit, ? to get help."
while
True
:
k
=
getch
()
method
=
keybindings
.
get
(
k
,
None
)
...
...
bindings/python-ctypes/header.py
View file @
07aea022
...
...
@@ -41,7 +41,21 @@ build_date="This will be replaced by the build date"
if
sys
.
platform
==
'linux2'
:
dll
=
ctypes
.
CDLL
(
'libvlc.so'
)
elif
sys
.
platform
==
'win32'
:
dll
=
ctypes
.
CDLL
(
'libvlc.dll'
)
import
ctypes.util
import
os
plugin_path
=
None
path
=
ctypes
.
util
.
find_library
(
'libvlc.dll'
)
if
path
is
None
:
# Try a standard location.
p
=
'c:
\
\
Program Files
\
\
VideoLAN
\
\
VLC
\
\
libvlc.dll'
if
os
.
path
.
exists
(
p
):
plugin_path
=
os
.
path
.
dirname
(
p
)
os
.
chdir
(
plugin_path
)
# If chdir failed, this will not work and raise an exception
path
=
'libvlc.dll'
else
:
plugin_path
=
os
.
path
.
dirname
(
path
)
dll
=
ctypes
.
CDLL
(
path
)
elif
sys
.
platform
==
'darwin'
:
# FIXME: should find a means to configure path
dll
=
ctypes
.
CDLL
(
'/Applications/VLC.app/Contents/MacOS/lib/libvlc.2.dylib'
)
...
...
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