Hello community,
here is the log from the commit of package python-python-vlc for
openSUSE:Factory checked in at 2020-07-27 17:40:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-vlc (Old)
and /work/SRC/openSUSE:Factory/.python-python-vlc.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-vlc"
Mon Jul 27 17:40:05 2020 rev:8 rq:822767 version:3.0.11115
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-python-vlc/python-python-vlc.changes
2020-04-29 20:54:49.521333636 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-vlc.new.3592/python-python-vlc.changes
2020-07-27 17:40:48.327022646 +0200
@@ -1,0 +2,5 @@
+Sat Jul 25 14:10:07 UTC 2020 - Luigi Baldoni <[email protected]>
+
+- Update to version 3.0.11115 (no changelog supplied)
+
+-------------------------------------------------------------------
Old:
----
python-vlc-3.0.9113.tar.gz
New:
----
python-vlc-3.0.11115.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-vlc.spec ++++++
--- /var/tmp/diff_new_pack.xD96ss/_old 2020-07-27 17:40:53.671027663 +0200
+++ /var/tmp/diff_new_pack.xD96ss/_new 2020-07-27 17:40:53.675027666 +0200
@@ -17,7 +17,7 @@
Name: python-python-vlc
-Version: 3.0.9113
+Version: 3.0.11115
Release: 0
Summary: VLC bindings for python
License: LGPL-2.0-or-later
++++++ python-vlc-3.0.9113.tar.gz -> python-vlc-3.0.11115.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/PKG-INFO
new/python-vlc-3.0.11115/PKG-INFO
--- old/python-vlc-3.0.9113/PKG-INFO 2020-04-29 13:16:27.890426000 +0200
+++ new/python-vlc-3.0.11115/PKG-INFO 2020-07-25 15:12:28.221189500 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: python-vlc
-Version: 3.0.9113
+Version: 3.0.11115
Summary: VLC bindings for python.
Home-page: http://wiki.videolan.org/PythonBinding
Author: Olivier Aubert
@@ -14,7 +14,7 @@
player. Note that it relies on an already present install of VLC.
It has been automatically generated from the include files of
- vlc 3.0.9, using generator 1.13.
+ vlc 3.0.11, using generator 1.15.
Keywords: vlc,video
Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/examples/glsurface.py~
new/python-vlc-3.0.11115/examples/glsurface.py~
--- old/python-vlc-3.0.9113/examples/glsurface.py~ 2020-03-03
16:30:47.000000000 +0100
+++ new/python-vlc-3.0.11115/examples/glsurface.py~ 1970-01-01
01:00:00.000000000 +0100
@@ -1,130 +0,0 @@
-import logging
-import time
-import ctypes
-from threading import Lock
-
-import numpy as np
-from OpenGL.GL import (
- GL_TEXTURE_2D, glTexSubImage2D, glTexImage2D,
- GL_BGRA, GL_RGBA, GL_BGR, GL_RGB,
- GL_UNSIGNED_BYTE)
-import vlc
-
-# patched ctypes func definitions because ones provided in vlc.py are incorrect
-_CorrectVideoLockCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.POINTER(ctypes.c_void_p))
-_CorrectVideoUnlockCb = ctypes.CFUNCTYPE(
- ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p,
ctypes.POINTER(ctypes.c_void_p))
-
-
-class Surface(object):
- """A lockable image buffer
- """
- def __init__(self, w, h):
- self._width = w
- self._height = h
-
- # size in bytes when RV32 *4 or RV24 * 3
- self._row_size = self._width * 3
- self._buf_size = self._height * self._row_size
- # allocate buffer
- self._buf1 = np.zeros(self._buf_size, dtype=np.ubyte)
- # get pointer to buffer
- self._buf_p = self._buf1.ctypes.data_as(ctypes.c_void_p)
- self._lock = Lock()
- _log.debug(self.buf_pointer)
- _log.debug(self.buf)
-
- def update_gl(self):
- # with self._lock:
- glTexSubImage2D(GL_TEXTURE_2D,
- 0, 0, 0,
- self._width,
- self._height,
- GL_BGR,
- GL_UNSIGNED_BYTE,
- self._buf1)
-
- def create_texture_gl(self):
- glTexImage2D(GL_TEXTURE_2D,
- 0,
- GL_RGB,
- self._width, # width
- self._height, # height
- 0,
- GL_BGR,
- GL_UNSIGNED_BYTE,
- None)
-
- @property
- def width(self):
- return self._width
-
- @property
- def height(self):
- return self._height
-
- @property
- def row_size(self):
- return self._row_size
-
- @property
- def buf(self):
- return self._buf1
-
- @property
- def buf_pointer(self):
- return self._buf_p
-
- def lock(self):
- self._lock.acquire()
-
- def unlock(self):
- self._lock.release()
-
- def __enter__(self, *args):
- return self._lock.__enter__(*args)
-
- def __exit__(self, *args):
- return self._lock.__exit__(*args)
-
- def get_libvlc_lock_callback(self):
- @_CorrectVideoLockCb
- def _cb(opaque, planes):
- self._lock.acquire()
- planes[0] = self._buf_p
-
- return _cb
-
- def get_libvlc_unlock_callback(self):
- @_CorrectVideoUnlockCb
- def _cb(opaque, picta, planes):
- self._lock.release()
-
- return _cb
-
-# I use this surface with something like:
-"""
-self.player = vlc.MediaPlayer(url)
-# play and stop so video_get_size gets a correct value
-# setting all callbacks to None prevents a window being created on play
-self.player.video_set_callbacks(None, None, None, None)
-# play and stop so video_get_size gets a correct value
-self.player.play()
-time.sleep(1)
-self.player.stop()
-w, h = self.player.video_get_size()
-self.surface = Surface(w, h)
-# need to keep a reference to the CFUNCTYPEs or else it will get GCed
-self._lock_cb = self.surface.get_libvlc_lock_callback()
-self._unlock_cb = self.surface.get_libvlc_unlock_callback()
-self.player.video_set_callbacks(self._lock_cb, self._unlock_cb, None, None)
-self.player.video_set_format(
- "RV24",
- self.surface.width,
- self.surface.height,
- self.surface.row_size)
-# this starts populating the surface's buf with pixels, from another thread
-self.player.play()
-# in main thread, where gl context is current:
-self.v.surface.update_gl()
-"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/examples/play_buffer.py
new/python-vlc-3.0.11115/examples/play_buffer.py
--- old/python-vlc-3.0.9113/examples/play_buffer.py 1970-01-01
01:00:00.000000000 +0100
+++ new/python-vlc-3.0.11115/examples/play_buffer.py 2020-06-16
10:09:57.000000000 +0200
@@ -0,0 +1,211 @@
+#!/usr/bin/env python3
+
+# Author: A.Invernizzi (@albestro on GitHub)
+# Date: Jun 03, 2020
+
+# MIT License <http://OpenSource.org/licenses/MIT>
+#
+# Copyright (C) 2020 -- A. Invernizzi, @albestro on github
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+"""
+Example usage of VLC API function `libvlc_media_new_callbacks`
+This function allows to create a VLC media `libvlc_media_t` specifying custom
+callbacks where the user can define how to manage and read the stream of data.
+
+The general use case for this is when you have data in memory and you want to
+play it (e.g. audio stream from a web radio).
+
+In this example, we are going to read playable data from files in a specified
+folder. In case you would want to read from a file, it is not the best way to
do it,
+but for the sake of this example we are going to read data into memory from
files.
+
+The example tries to highlight the separation of concerns between the
callbacks and
+the application logic, so it would hopefully make clear how to integrate the
VLC API
+with existing libraries.
+
+In particular, we have two main parts:
+ - StreamProvider: which is a class that implements the logic; "scrape" a
folder
+ for files with a specific extensions, and provide methods that retrieves
data.
+ - VLC callabacks that uses a StreamProvider object
+"""
+
+import argparse
+import ctypes
+import os
+
+import vlc
+
+
+class StreamProviderDir(object):
+ def __init__(self, rootpath, file_ext):
+ self._media_files = []
+ self._rootpath = rootpath
+ self._file_ext = file_ext
+ self._index = 0
+
+ def open(self):
+ """
+ this function is responsible of opening the media.
+ it could have been done in the __init__, but it is just an example
+
+ in this case it scan the specified folder, but it could also scan a
+ remote url or whatever you prefer.
+ """
+
+ print("read file list")
+ for entry in os.listdir(self._rootpath):
+ if os.path.splitext(entry)[1] == f".{self._file_ext}":
+ self._media_files.append(os.path.join(self._rootpath, entry))
+ self._media_files.sort()
+
+ print("playlist:")
+ for index, media_file in enumerate(self._media_files):
+ print(f"[{index}] {media_file}")
+
+ def release_resources(self):
+ """
+ In this example this function is just a placeholder,
+ in a more complex example this may release resources after the usage,
+ e.g. closing the socket from where we retrieved media data
+ """
+ print("releasing stream provider")
+
+ def seek(self, offset):
+ """
+ Again, a placeholder, not useful for the example
+ """
+ print(f"requested seek with offset={offset}")
+
+ def get_data(self):
+ """
+ It reads the current file in the list and returns the binary data
+ In this example it reads from file, but it could have downloaded data
from an url
+ """
+ print(f"reading file [{self._index}] ", end='')
+
+ if self._index == len(self._media_files):
+ print("file list is over")
+ return b''
+
+ print(f"{self._media_files[self._index]}")
+ with open(self._media_files[self._index], 'rb') as stream:
+ data = stream.read()
+
+ self._index = self._index + 1
+
+ return data
+
+
+# HERE THERE ARE THE CALLBACKS USED BY THE MEDIA CREATED IN THE "MAIN"
+# a callback in its simplest form is a python function decorated with the
specific @vlc.CallbackDecorators.*
+
[email protected]
+def media_open_cb(opaque, data_pointer, size_pointer):
+ print("OPEN", opaque, data_pointer, size_pointer)
+
+ stream_provider = ctypes.cast(opaque,
ctypes.POINTER(ctypes.py_object)).contents.value
+
+ stream_provider.open()
+
+ data_pointer.contents.value = opaque
+ size_pointer.value = 1 ** 64 - 1
+
+ return 0
+
+
[email protected]
+def media_read_cb(opaque, buffer, length):
+ print("READ", opaque, buffer, length)
+
+ stream_provider = ctypes.cast(opaque,
ctypes.POINTER(ctypes.py_object)).contents.value
+
+ new_data = stream_provider.get_data()
+ bytes_read = len(new_data)
+
+ if bytes_read > 0:
+ buffer_array = ctypes.cast(buffer, ctypes.POINTER(ctypes.c_char *
bytes_read))
+ for index, b in enumerate(new_data):
+ buffer_array.contents[index] = ctypes.c_char(b)
+
+ print(f"just read f{bytes_read}B")
+ return bytes_read
+
+
[email protected]
+def media_seek_cb(opaque, offset):
+ print("SEEK", opaque, offset)
+
+ stream_provider = ctypes.cast(opaque,
ctypes.POINTER(ctypes.py_object)).contents.value
+
+ stream_provider.seek(offset)
+
+ return 0
+
+
[email protected]
+def media_close_cb(opaque):
+ print("CLOSE", opaque)
+
+ stream_provider = ctypes.cast(opaque,
ctypes.POINTER(ctypes.py_object)).contents.value
+
+ stream_provider.release_resources()
+
+
+# MAIN
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(
+ description='play files found in specified media folder (in
alphabetic order)',
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser.add_argument(
+ 'media_folder',
+ help='where to find files to play')
+ parser.add_argument(
+ '--extension',
+ default='ts',
+ help='file extension of the files to play')
+ args = parser.parse_args()
+
+ # helper object acting as media data provider
+ # it is just to highlight how the opaque pointer in the callback can be
used
+ # and that the logic can be isolated from the callbacks
+ stream_provider = StreamProviderDir(args.media_folder, args.extension)
+
+ # these two lines to highlight how to pass a python object using ctypes
+ # it is verbose, but you can see the steps required
+ stream_provider_obj = ctypes.py_object(stream_provider)
+ stream_provider_ptr = ctypes.byref(stream_provider_obj)
+
+ # create an instance of vlc
+ instance = vlc.Instance()
+
+ # setup the callbacks for the media
+ media = instance.media_new_callbacks(
+ media_open_cb,
+ media_read_cb,
+ media_seek_cb,
+ media_close_cb,
+ stream_provider_ptr)
+ player = media.player_new_from_media()
+
+ # play/stop
+ player.play()
+ input("press enter to quit")
+ player.stop()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/examples/tkvlc.py
new/python-vlc-3.0.11115/examples/tkvlc.py
--- old/python-vlc-3.0.9113/examples/tkvlc.py 2019-08-03 19:03:50.000000000
+0200
+++ new/python-vlc-3.0.11115/examples/tkvlc.py 2020-05-07 19:32:39.000000000
+0200
@@ -19,15 +19,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#
"""A simple example for VLC python bindings using tkinter.
-
Requires Python 3.4 or later.
-
Author: Patrick Fay
Date: 23-09-2015
"""
# Tested with Python 3.7.4, tkinter/Tk 8.6.9 on macOS 10.13.6 only.
-__version__ = '19.07.29' # mrJean1 at Gmail dot com
+__version__ = '20.05.04' # mrJean1 at Gmail
# import external libraries
import vlc
@@ -49,7 +47,7 @@
_isMacOS = sys.platform.startswith('darwin')
_isWindows = sys.platform.startswith('win')
-_isLinux = sys.platform.startswith('linux')
+_isLinux = sys.platform.startswith('linux')
if _isMacOS:
from ctypes import c_void_p, cdll
@@ -59,7 +57,8 @@
# to match the version number of tkinter, _tkinter, etc.
try:
libtk = 'libtk%s.dylib' % (Tk.TkVersion,)
- libtk = joined(sys.prefix, 'lib', libtk)
+ prefix = getattr(sys, 'base_prefix', sys.prefix)
+ libtk = joined(prefix, 'lib', libtk)
dylib = cdll.LoadLibrary(libtk)
# getNSView = dylib.TkMacOSXDrawableView is the
# proper function to call, but that is non-public
@@ -89,7 +88,6 @@
class _Tk_Menu(Tk.Menu):
'''Tk.Menu extended with .add_shortcut method.
-
Note, this is a kludge just to get Command-key shortcuts to
work on macOS. Other modifiers like Ctrl-, Shift- and Option-
are not handled in this code.
@@ -99,7 +97,6 @@
def add_shortcut(self, label='', key='', command=None, **kwds):
'''Like Tk.menu.add_command extended with shortcut key.
-
If needed use modifiers like Shift- and Alt_ or Option-
as before the shortcut key character. Do not include
the Command- or Control- modifier nor the <...> brackets
@@ -199,13 +196,18 @@
self.muteIndex = fileMenu.index("Mute")
# first, top panel shows video
+
self.videopanel = ttk.Frame(self.parent)
self.canvas = Tk.Canvas(self.videopanel)
self.canvas.pack(fill=Tk.BOTH, expand=1)
self.videopanel.pack(fill=Tk.BOTH, expand=1)
# panel to hold buttons
- buttons = ttk.Frame(self.parent)
+ self.buttons_panel = Tk.Toplevel(self.parent)
+ self.buttons_panel.title("")
+ self.is_buttons_panel_anchor_active = False
+
+ buttons = ttk.Frame(self.buttons_panel)
self.playButton = ttk.Button(buttons, text="Play", command=self.OnPlay)
stop = ttk.Button(buttons, text="Stop", command=self.OnStop)
self.muteButton = ttk.Button(buttons, text="Mute", command=self.OnMute)
@@ -218,11 +220,12 @@
self.volSlider = Tk.Scale(buttons, variable=self.volVar,
command=self.OnVolume,
from_=0, to=100, orient=Tk.HORIZONTAL,
length=200,
showvalue=0, label='Volume')
- self.volSlider.pack(side=Tk.LEFT)
- buttons.pack(side=Tk.BOTTOM)
+ self.volSlider.pack(side=Tk.RIGHT)
+ buttons.pack(side=Tk.BOTTOM, fill=Tk.X)
+
# panel to hold player time slider
- timers = ttk.Frame(self.parent)
+ timers = ttk.Frame(self.buttons_panel)
self.timeVar = Tk.DoubleVar()
self.timeSliderLast = 0
self.timeSlider = Tk.Scale(timers, variable=self.timeVar,
command=self.OnTime,
@@ -232,6 +235,7 @@
self.timeSliderUpdate = time.time()
timers.pack(side=Tk.BOTTOM, fill=Tk.X)
+
# VLC player
args = []
if _isLinux:
@@ -242,6 +246,26 @@
self.parent.bind("<Configure>", self.OnConfigure) # catch window
resize, etc.
self.parent.update()
+ # After parent.update() otherwise panel is ignored.
+ self.buttons_panel.overrideredirect(True)
+
+ # Estetic, to keep our video panel at least as wide as our buttons
panel.
+ self.parent.minsize(width=502, height=0)
+
+ if _isMacOS:
+ # Only tested on MacOS so far. Enable for other OS after verified
tests.
+ self.is_buttons_panel_anchor_active = True
+
+ # Detect dragging of the buttons panel.
+ self.buttons_panel.bind("<Button-1>", lambda event: setattr(self,
"has_clicked_on_buttons_panel", event.y < 0))
+ self.buttons_panel.bind("<B1-Motion>",
self._DetectButtonsPanelDragging)
+ self.buttons_panel.bind("<ButtonRelease-1>", lambda _:
setattr(self, "has_clicked_on_buttons_panel", False))
+ self.has_clicked_on_buttons_panel = False
+ else:
+ self.is_buttons_panel_anchor_active = False
+
+ self._AnchorButtonsPanel()
+
self.OnTick() # set the timer up
def OnClose(self, *unused):
@@ -251,7 +275,24 @@
self.parent.quit() # stops mainloop
self.parent.destroy() # this is necessary on Windows to avoid
# ... Fatal Python Error: PyEval_RestoreThread: NULL tstate
- sys.exit(0)
+
+ def _DetectButtonsPanelDragging(self, _):
+ """If our last click was on the boarder
+ we disable the anchor.
+ """
+ if self.has_clicked_on_buttons_panel:
+ self.is_buttons_panel_anchor_active = False
+ self.buttons_panel.unbind("<Button-1>")
+ self.buttons_panel.unbind("<B1-Motion>")
+ self.buttons_panel.unbind("<ButtonRelease-1>")
+
+ def _AnchorButtonsPanel(self):
+ video_height = self.parent.winfo_height()
+ panel_x = self.parent.winfo_x()
+ panel_y = self.parent.winfo_y() + video_height + 23 # 23 seems to put
the panel just below our video.
+ panel_height = self.buttons_panel.winfo_height()
+ panel_width = self.parent.winfo_width()
+ self.buttons_panel.geometry("%sx%s+%s+%s" % (panel_width,
panel_height, panel_x, panel_y))
def OnConfigure(self, *unused):
"""Some widget configuration changed.
@@ -259,6 +300,9 @@
# <https://www.Tcl.Tk/man/tcl8.6/TkCmd/bind.htm#M12>
self._geometry = '' # force .OnResize in .OnTick, recursive?
+ if self.is_buttons_panel_anchor_active:
+ self._AnchorButtonsPanel()
+
def OnFullScreen(self, *unused):
"""Toggle full screen, macOS only.
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/python_vlc.egg-info/PKG-INFO
new/python-vlc-3.0.11115/python_vlc.egg-info/PKG-INFO
--- old/python-vlc-3.0.9113/python_vlc.egg-info/PKG-INFO 2020-04-29
13:16:27.000000000 +0200
+++ new/python-vlc-3.0.11115/python_vlc.egg-info/PKG-INFO 2020-07-25
15:12:28.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: python-vlc
-Version: 3.0.9113
+Version: 3.0.11115
Summary: VLC bindings for python.
Home-page: http://wiki.videolan.org/PythonBinding
Author: Olivier Aubert
@@ -14,7 +14,7 @@
player. Note that it relies on an already present install of VLC.
It has been automatically generated from the include files of
- vlc 3.0.9, using generator 1.13.
+ vlc 3.0.11, using generator 1.15.
Keywords: vlc,video
Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/python_vlc.egg-info/SOURCES.txt
new/python-vlc-3.0.11115/python_vlc.egg-info/SOURCES.txt
--- old/python-vlc-3.0.9113/python_vlc.egg-info/SOURCES.txt 2020-04-29
13:16:27.000000000 +0200
+++ new/python-vlc-3.0.11115/python_vlc.egg-info/SOURCES.txt 2020-07-25
15:12:28.000000000 +0200
@@ -6,9 +6,9 @@
vlc.py
examples/cocoavlc.py
examples/glsurface.py
-examples/glsurface.py~
examples/gtk2vlc.py
examples/gtkvlc.py
+examples/play_buffer.py
examples/pyobjcvlc.py
examples/pyqt5vlc.py
examples/qtvlc.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/setup.py
new/python-vlc-3.0.11115/setup.py
--- old/python-vlc-3.0.9113/setup.py 2020-04-29 13:14:12.000000000 +0200
+++ new/python-vlc-3.0.11115/setup.py 2020-07-25 15:07:56.000000000 +0200
@@ -4,7 +4,7 @@
from setuptools import setup
setup(name='python-vlc',
- version = '3.0.9113',
+ version = '3.0.11115',
author='Olivier Aubert',
author_email='[email protected]',
maintainer='Olivier Aubert',
@@ -35,5 +35,5 @@
player. Note that it relies on an already present install of VLC.
It has been automatically generated from the include files of
- vlc 3.0.9, using generator 1.13.
+ vlc 3.0.11, using generator 1.15.
""")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-vlc-3.0.9113/vlc.py
new/python-vlc-3.0.11115/vlc.py
--- old/python-vlc-3.0.9113/vlc.py 2020-04-29 13:13:52.000000000 +0200
+++ new/python-vlc-3.0.11115/vlc.py 2020-07-25 15:07:41.000000000 +0200
@@ -52,10 +52,10 @@
import logging
logger = logging.getLogger(__name__)
-__version__ = "3.0.9113"
-__libvlc_version__ = "3.0.9"
-__generator_version__ = "1.13"
-build_date = "Wed Apr 29 13:13:52 2020 3.0.9"
+__version__ = "3.0.11115"
+__libvlc_version__ = "3.0.11"
+__generator_version__ = "1.15"
+build_date = "Sat Jul 25 15:07:40 2020 3.0.11"
# The libvlc doc states that filenames are expected to be in UTF8, do
# not rely on sys.getfilesystemencoding() which will be confused,
@@ -163,11 +163,11 @@
p = os.getcwd()
os.chdir(plugin_path)
# if chdir failed, this will raise an exception
- dll = ctypes.CDLL(libname)
+ dll = ctypes.CDLL('.\\' + libname)
# restore cwd after dll has been loaded
os.chdir(p)
else: # may fail
- dll = ctypes.CDLL(libname)
+ dll = ctypes.CDLL('.\\' + libname)
else:
plugin_path = os.path.dirname(p)
dll = ctypes.CDLL(p)
@@ -1134,29 +1134,6 @@
def __str__(self):
return '%s #%d %s (uri %s)' % (self.__class__.__name__, self.id,
self.name, self.uri)
-class Position(object):
- """Enum-like, immutable window position constants.
-
- See e.g. VideoMarqueeOption.Position.
- """
- Center = 0
- Left = 1
- CenterLeft = 1
- Right = 2
- CenterRight = 2
- Top = 4
- TopCenter = 4
- TopLeft = 5
- TopRight = 6
- Bottom = 8
- BottomCenter = 8
- BottomLeft = 9
- BottomRight = 10
- def __init__(self, *unused):
- raise TypeError('constants only')
- def __setattr__(self, *unused): #PYCHOK expected
- raise TypeError('immutable constants')
-
class Rectangle(_Cstruct):
_fields_ = [
('top', ctypes.c_int),
@@ -1555,11 +1532,11 @@
pass
class CallbackDecorators(object):
"Class holding various method decorators for callback functions."
- Callback = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_void_p)
+ Callback = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_void_p)
Callback.__doc__ = '''Callback function notification.
@param p_event: the event triggering the callback.
'''
- LogCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int,
Log_ptr, ctypes.c_char_p, ctypes.c_void_p)
+ LogCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int, Log_ptr,
ctypes.c_char_p, ctypes.c_void_p)
LogCb.__doc__ = '''Callback prototype for LibVLC log message handler.
@param data: data pointer as given to L{libvlc_log_set}().
@param level: message level (@ref L{LogLevel}).
@@ -1567,7 +1544,7 @@
@param fmt: printf() format string (as defined by ISO C11).
@param args: variable argument list for the format @note Log message
handlers B{must} be thread-safe. @warning The message context pointer, the
format string parameters and the variable arguments are only valid until the
callback returns.
'''
- MediaOpenCb = ctypes.CFUNCTYPE(ctypes.POINTER(ctypes.c_int),
ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p),
ctypes.POINTER(ctypes.c_uint64))
+ MediaOpenCb = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p,
ctypes.POINTER(ctypes.c_void_p), ctypes.POINTER(ctypes.c_uint64))
MediaOpenCb.__doc__ = '''Callback prototype to open a custom bitstream
input media.
The same media item can be opened multiple times. Each time, this
callback
is invoked. It should allocate and initialize any instance-specific
@@ -1576,20 +1553,20 @@
@param opaque: private pointer as passed to
L{libvlc_media_new_callbacks}().
@return: datap storage space for a private data pointer, sizep byte
length of the bitstream or UINT64_MAX if unknown.
'''
- MediaReadCb = ctypes.CFUNCTYPE(ctypes.POINTER(ctypes.c_ssize_t),
ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.c_size_t)
+ MediaReadCb = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_void_p,
ctypes.POINTER(ctypes.c_char), ctypes.c_size_t)
MediaReadCb.__doc__ = '''Callback prototype to read data from a custom
bitstream input media.
@param opaque: private pointer as set by the @ref libvlc_media_open_cb
callback.
@param buf: start address of the buffer to read data into.
@param len: bytes length of the buffer.
@return: strictly positive number of bytes read, 0 on end-of-stream,
or -1 on non-recoverable error @note If no data is immediately available, then
the callback should sleep. @warning The application is responsible for avoiding
deadlock situations. In particular, the callback should return an error if
playback is stopped; if it does not return, then L{libvlc_media_player_stop}()
will never return.
'''
- MediaSeekCb = ctypes.CFUNCTYPE(ctypes.POINTER(ctypes.c_int),
ctypes.c_void_p, ctypes.c_uint64)
+ MediaSeekCb = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p,
ctypes.c_uint64)
MediaSeekCb.__doc__ = '''Callback prototype to seek a custom bitstream
input media.
@param opaque: private pointer as set by the @ref libvlc_media_open_cb
callback.
@param offset: absolute byte offset to seek to.
@return: 0 on success, -1 on error.
'''
- MediaCloseCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p)
+ MediaCloseCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p)
MediaCloseCb.__doc__ = '''Callback prototype to close a custom bitstream
input media.
@param opaque: private pointer as set by the @ref libvlc_media_open_cb
callback.
'''
@@ -1603,7 +1580,7 @@
@param planes: start address of the pixel planes (LibVLC allocates the
array of void pointers, this callback must initialize the array) [OUT].
@return: a private pointer for the display and unlock callbacks to
identify the picture buffers.
'''
- VideoUnlockCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p))
+ VideoUnlockCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_void_p,
ctypes.POINTER(ctypes.c_void_p))
VideoUnlockCb.__doc__ = '''Callback prototype to unlock a picture buffer.
When the video frame decoding is complete, the unlock callback is
invoked.
This callback might not be needed at all. It is only an indication
that the
@@ -1614,14 +1591,14 @@
@param picture: private pointer returned from the @ref
libvlc_video_lock_cb callback [IN].
@param planes: pixel planes as defined by the @ref
libvlc_video_lock_cb callback (this parameter is only for convenience) [IN].
'''
- VideoDisplayCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_void_p)
+ VideoDisplayCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_void_p)
VideoDisplayCb.__doc__ = '''Callback prototype to display a picture.
When the video frame needs to be shown, as determined by the media
playback
clock, the display callback is invoked.
@param opaque: private pointer as passed to
L{libvlc_video_set_callbacks}() [IN].
@param picture: private pointer returned from the @ref
libvlc_video_lock_cb callback [IN].
'''
- VideoFormatCb = ctypes.CFUNCTYPE(ctypes.POINTER(ctypes.c_uint),
ctypes.POINTER(ctypes.c_void_p), ctypes.c_char_p,
ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint),
ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint))
+ VideoFormatCb = ctypes.CFUNCTYPE(ctypes.c_uint,
ctypes.POINTER(ctypes.c_void_p), ctypes.c_char_p,
ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint),
ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint))
VideoFormatCb.__doc__ = '''Callback prototype to configure picture buffers
format.
This callback gets the format of the video as output by the video
decoder
and the chain of video filters (if any). It can opt to change any
parameter
@@ -1634,11 +1611,11 @@
@param pitches: table of scanline pitches in bytes for each pixel
plane (the table is allocated by LibVLC) [OUT].
@return: lines table of scanlines count for each plane.
'''
- VideoCleanupCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p)
+ VideoCleanupCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p)
VideoCleanupCb.__doc__ = '''Callback prototype to configure picture
buffers format.
@param opaque: private pointer as passed to
L{libvlc_video_set_callbacks}() (and possibly modified by @ref
libvlc_video_format_cb) [IN].
'''
- AudioPlayCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_void_p, ctypes.c_uint, ctypes.c_int64)
+ AudioPlayCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_uint, ctypes.c_int64)
AudioPlayCb.__doc__ = '''Callback prototype for audio playback.
The LibVLC media player decodes and post-processes the audio signal
asynchronously (in an internal thread). Whenever audio samples are
ready
@@ -1656,14 +1633,14 @@
@param count: number of audio samples to play back.
@param pts: expected play time stamp (see libvlc_delay()).
'''
- AudioPauseCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_int64)
+ AudioPauseCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int64)
AudioPauseCb.__doc__ = '''Callback prototype for audio pause.
LibVLC invokes this callback to pause audio playback.
@note: The pause callback is never called if the audio is already
paused.
@param data: data pointer as passed to L{libvlc_audio_set_callbacks}()
[IN].
@param pts: time stamp of the pause request (should be elapsed
already).
'''
- AudioResumeCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_int64)
+ AudioResumeCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int64)
AudioResumeCb.__doc__ = '''Callback prototype for audio resumption.
LibVLC invokes this callback to resume audio playback after it was
previously paused.
@@ -1671,27 +1648,27 @@
@param data: data pointer as passed to L{libvlc_audio_set_callbacks}()
[IN].
@param pts: time stamp of the resumption request (should be elapsed
already).
'''
- AudioFlushCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_int64)
+ AudioFlushCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int64)
AudioFlushCb.__doc__ = '''Callback prototype for audio buffer flush.
LibVLC invokes this callback if it needs to discard all pending
buffers and
stop playback as soon as possible. This typically occurs when the
media is
stopped.
@param data: data pointer as passed to L{libvlc_audio_set_callbacks}()
[IN].
'''
- AudioDrainCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p)
+ AudioDrainCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p)
AudioDrainCb.__doc__ = '''Callback prototype for audio buffer drain.
LibVLC may invoke this callback when the decoded audio track is ending.
There will be no further decoded samples for the track, but playback
should
nevertheless continue until all already pending buffers are rendered.
@param data: data pointer as passed to L{libvlc_audio_set_callbacks}()
[IN].
'''
- AudioSetVolumeCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_float, ctypes.c_bool)
+ AudioSetVolumeCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_float,
ctypes.c_bool)
AudioSetVolumeCb.__doc__ = '''Callback prototype for audio volume change.
@param data: data pointer as passed to L{libvlc_audio_set_callbacks}()
[IN].
@param volume: software volume (1. = nominal, 0. = mute).
@param mute: muted flag.
'''
- AudioSetupCb = ctypes.CFUNCTYPE(ctypes.POINTER(ctypes.c_int),
ctypes.POINTER(ctypes.c_void_p), ctypes.c_char_p,
ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint))
+ AudioSetupCb = ctypes.CFUNCTYPE(ctypes.c_int,
ctypes.POINTER(ctypes.c_void_p), ctypes.c_char_p,
ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint))
AudioSetupCb.__doc__ = '''Callback prototype to setup the audio playback.
This is called when the media player needs to create a new audio
output.
@param opaque: pointer to the data pointer passed to
L{libvlc_audio_set_callbacks}() [IN/OUT].
@@ -1700,7 +1677,7 @@
@param channels: channels count [IN/OUT].
@return: 0 on success, anything else to skip audio playback.
'''
- AudioCleanupCb = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p)
+ AudioCleanupCb = ctypes.CFUNCTYPE(None, ctypes.c_void_p)
AudioCleanupCb.__doc__ = '''Callback prototype for audio playback cleanup.
This is called when the media player no longer needs an audio output.
@param opaque: data pointer as passed to
L{libvlc_audio_set_callbacks}() [IN].