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
0680c6ed
Commit
0680c6ed
authored
May 25, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python bindings: remove obsolete vlc_internal module
parent
518dc329
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
996 deletions
+1
-996
bindings/python/setup-internal.py
bindings/python/setup-internal.py
+0
-105
bindings/python/setup.py
bindings/python/setup.py
+1
-2
bindings/python/vlc_internal.c
bindings/python/vlc_internal.c
+0
-739
bindings/python/vlc_internal.h
bindings/python/vlc_internal.h
+0
-71
bindings/python/vlcwrapper.py
bindings/python/vlcwrapper.py
+0
-79
No files found.
bindings/python/setup-internal.py
deleted
100644 → 0
View file @
518dc329
from
distutils.core
import
setup
,
Extension
import
os
# Get build variables (buildir, srcdir)
try
:
top_builddir
=
os
.
environ
[
'top_builddir'
]
except
KeyError
:
# Note: do not initialize here, so that we get
# a correct default value if the env. var is
# defined but empty
top_builddir
=
None
if
not
top_builddir
:
top_builddir
=
os
.
path
.
join
(
'..'
,
'..'
)
os
.
environ
[
'top_builddir'
]
=
top_builddir
try
:
srcdir
=
os
.
environ
[
'srcdir'
]
except
KeyError
:
# Note: same as above
srcdir
=
None
if
not
srcdir
:
srcdir
=
'.'
def
get_vlcconfig
():
vlcconfig
=
None
for
n
in
(
'vlc-config'
,
os
.
path
.
join
(
top_builddir
,
'vlc-config'
)):
if
os
.
path
.
exists
(
n
):
vlcconfig
=
n
break
if
vlcconfig
is
None
:
print
"*** Warning *** Cannot find vlc-config"
elif
os
.
sys
.
platform
==
'win32'
:
# Win32 does not know how to invoke the shell itself.
vlcconfig
=
"sh %s"
%
vlcconfig
return
vlcconfig
def
get_vlc_version
():
vlcconfig
=
get_vlcconfig
()
if
vlcconfig
is
None
:
return
""
else
:
version
=
os
.
popen
(
'%s --version'
%
vlcconfig
,
'r'
).
readline
().
strip
()
return
version
def
get_cflags
():
vlcconfig
=
get_vlcconfig
()
if
vlcconfig
is
None
:
return
[]
else
:
cflags
=
os
.
popen
(
'%s --cflags vlc'
%
vlcconfig
,
'r'
).
readline
().
rstrip
().
split
()
return
cflags
def
get_ldflags
():
vlcconfig
=
get_vlcconfig
()
if
vlcconfig
is
None
:
return
[]
else
:
ldflags
=
[]
if
os
.
sys
.
platform
==
'darwin'
:
ldflags
=
"-read_only_relocs warning"
.
split
()
ldflags
.
extend
(
os
.
popen
(
'%s --libs vlc external'
%
vlcconfig
,
'r'
).
readline
().
rstrip
().
split
())
if
os
.
sys
.
platform
==
'darwin'
:
ldflags
.
append
(
'-lstdc++'
)
return
ldflags
#source_files = [ 'vlc_module.c', 'vlc_object.c', 'vlc_mediacontrol.c',
# 'vlc_position.c', 'vlc_instance.c', 'vlc_input.c' ]
source_files
=
[
'vlc_internal.c'
]
# To compile in a local vlc tree
vlclocal
=
Extension
(
'vlcinternal'
,
sources
=
[
os
.
path
.
join
(
srcdir
,
f
)
for
f
in
source_files
],
include_dirs
=
[
top_builddir
,
os
.
path
.
join
(
srcdir
,
'..'
,
'..'
,
'include'
),
srcdir
,
'/usr/win32/include'
],
extra_objects
=
[
],
extra_compile_args
=
get_cflags
(),
extra_link_args
=
[
'-L'
+
os
.
path
.
join
(
top_builddir
,
'src'
,
'.libs'
)
]
+
get_ldflags
(),
)
setup
(
name
=
'VLC Internal Bindings'
,
version
=
get_vlc_version
(),
#scripts = [ os.path.join( srcdir, 'vlcwrapper.py') ],
keywords
=
[
'vlc'
,
'video'
],
license
=
"GPL"
,
description
=
"""VLC internal bindings for python.
This module provides an Object type, which gives a low-level access to
the vlc objects and their variables.
Example session:
import vlcinternal
# Access lowlevel objets
o=vlcinternal.Object(1)
o.info()
i=o.find_object('input')
i.list()
i.get('time')
"""
,
ext_modules
=
[
vlclocal
])
bindings/python/setup.py
View file @
0680c6ed
...
...
@@ -91,8 +91,7 @@ setup (name = 'python-vlc',
author
=
'Olivier Aubert'
,
author_email
=
'olivier.aubert@liris.cnrs.fr'
,
url
=
'http://wiki.videolan.org/PythonBinding'
,
#scripts = [ os.path.join( srcdir, 'vlcwidget.py') ],
py_modules
=
[
'vlcwrapper'
],
py_modules
=
[
'vlcwidget'
],
keywords
=
[
'vlc'
,
'video'
],
license
=
"GPL"
,
description
=
"VLC bindings for python."
,
...
...
bindings/python/vlc_internal.c
deleted
100644 → 0
View file @
518dc329
This diff is collapsed.
Click to expand it.
bindings/python/vlc_internal.h
deleted
100644 → 0
View file @
518dc329
/*****************************************************************************
* vlc_internal.h: Header for the Python vlcinternal binding
*****************************************************************************
* Copyright (C) 1998-2004 the VideoLAN team
* $Id$
*
* Authors: Olivier Aubert <oaubert at bat710.univ-lyon1.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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _VLCINTERNAL_H
#define _VLCINTERNAL_H 1
/* We need to access some internal features of VLC (for vlc_object) */
/* This is gruik as we are not libvlc at all */
#define __LIBVLC__
#include <Python.h>
#include "structmember.h"
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/libvlc.h>
/* Even gruiker ! We access variable_t ! */
#include "../../src/misc/variables.h"
/* Python 2.5 64-bit support compatibility define */
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef
int
Py_ssize_t
;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
/**********************************************************************
* VLC Object
**********************************************************************/
#define VLCOBJ(self) (((vlcObject*)self)->p_object)
/**********************************************************************
* VLCObject Object
**********************************************************************/
typedef
struct
{
PyObject_HEAD
vlc_object_t
*
p_object
;
int
b_released
;
}
vlcObject
;
/* Forward declarations */
staticforward
PyTypeObject
vlcObject_Type
;
/* Long long conversion on Mac os X/ppc */
#if defined (__ppc__) || defined(__ppc64__)
#define ntohll(x) ((long long) x >> 64)
#else
#define ntohll(x) (x)
#endif
#endif
bindings/python/vlcwrapper.py
deleted
100644 → 0
View file @
518dc329
"""Wrapper around vlc module in order to ease the use of vlc.Object
class (completion in ipython, access variable as attributes, etc).
$Id$
"""
import
vlc
import
vlcinternal
class
VLCObject
(
object
):
def
__init__
(
self
,
id
):
object
.
__setattr__
(
self
,
'_o'
,
vlcinternal
.
Object
(
id
))
def
find
(
self
,
typ
):
"""Returns a VLCObject for the given child.
See vlc.Object.find_object.__doc__ for the different values of typ.
"""
t
=
self
.
_o
.
find_object
(
typ
)
if
t
is
not
None
:
return
VLCObject
(
t
.
info
()[
'object-id'
])
else
:
return
None
def
__str__
(
self
):
"""Returns a string representation of the object.
"""
i
=
self
.
_o
.
info
()
return
"VLCObject %d (%s) : %s"
%
(
i
[
'object-id'
],
i
[
'object-type'
],
i
[
'object-name'
])
def
tree
(
self
,
prefix
=
" "
):
"""Displays all children as a tree of VLCObject
"""
res
=
prefix
+
str
(
self
)
+
"
\
n
"
for
i
in
self
.
_o
.
children
():
t
=
VLCObject
(
i
)
res
+=
t
.
tree
(
prefix
=
prefix
+
" "
)
return
res
def
__getattribute__
(
self
,
attr
):
"""Converts attribute access to access to variables.
"""
if
attr
==
'__members__'
:
# Return the list of variables
o
=
object
.
__getattribute__
(
self
,
'_o'
)
l
=
dir
(
o
)
l
.
extend
([
n
.
replace
(
'-'
,
'_'
)
for
n
in
o
.
list
()
])
return
l
try
:
return
object
.
__getattribute__
(
self
,
attr
)
except
AttributeError
,
e
:
try
:
return
self
.
_o
.
__getattribute__
(
attr
)
except
AttributeError
,
e
:
attr
=
attr
.
replace
(
'_'
,
'-'
)
if
attr
in
self
.
_o
.
list
():
return
self
.
_o
.
get
(
attr
)
else
:
raise
e
def
__setattr__
(
self
,
name
,
value
):
"""Handle attribute assignment.
"""
n
=
name
.
replace
(
'_'
,
'-'
)
if
n
in
self
.
_o
.
list
():
self
.
_o
.
set
(
n
,
value
)
else
:
object
.
__setattr__
(
self
,
name
,
value
)
def
test
(
f
=
'/tmp/k.mpg'
):
global
mc
,
o
mc
=
vlc
.
MediaControl
()
mc
.
playlist_add_item
(
f
)
mc
.
start
(
0
)
mc
.
pause
(
0
)
o
=
VLCObject
(
0
)
v
=
o
.
find
(
'vout'
)
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