From 3d28983a8c01c19a10349d97f62d998934ff95b5 Mon Sep 17 00:00:00 2001 From: kanehekili Date: Sat, 26 Aug 2023 23:23:33 +0200 Subject: [PATCH] Pil to QTImage conversion fix --- build/DEB-template/debian/control | 4 +-- build/build.properties | 10 +++--- build/build.xml | 58 +++++++++++++++++++++++++++++-- src/MpvPlayer.py | 13 ++++++- src/lib/mpv.py | 15 +++++--- 5 files changed, 85 insertions(+), 15 deletions(-) diff --git a/build/DEB-template/debian/control b/build/DEB-template/debian/control index 74ec8aa..717b2f2 100644 --- a/build/DEB-template/debian/control +++ b/build/DEB-template/debian/control @@ -2,13 +2,13 @@ Source: videocut Maintainer: kanehekili Section: video Priority: optional -Build-Depends: python3, debhelper, python3-pyqt5, libc6-dev, libavcodec-dev, libavformat-dev +Build-Depends: debhelper, libc6-dev, libavcodec-dev, libavformat-dev Standards-Version: 2.0.0 Architecture: all -Depends: python3, ffmpeg, python3-pyqt5, python3-pil, libmpv1,python3-pyqt5.qtopengl,${shlibs:Depends}, ${misc:Depends} +Depends: @xlibsx@, ${shlibs:Depends}, ${misc:Depends} Description: Fast and lossless videocutter for mp2,mp4,mkv,av-1 and more Section: video Package: videocut diff --git a/build/build.properties b/build/build.properties index d6d6dc2..b628b20 100644 --- a/build/build.properties +++ b/build/build.properties @@ -1,5 +1,5 @@ -version=2.2.0 -ubu0=bionic -ubu1=focal -ubu2=jammy -pkgrelease=1 \ No newline at end of file +version=2.2.1 +ubu0=focal +ubu1=jammy +ubu2=lunar +pkgrelease=2 \ No newline at end of file diff --git a/build/build.xml b/build/build.xml index 07952bd..9b8945c 100644 --- a/build/build.xml +++ b/build/build.xml @@ -38,6 +38,7 @@ + @@ -119,6 +120,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -127,7 +177,8 @@ - + + @@ -146,7 +197,7 @@ - + @@ -175,7 +226,8 @@ - + + diff --git a/src/MpvPlayer.py b/src/MpvPlayer.py index 2e0c5c2..dc1855c 100644 --- a/src/MpvPlayer.py +++ b/src/MpvPlayer.py @@ -349,7 +349,18 @@ def screenshotAtFrame(self,frameNumber): def screenshotImage(self): im=self.mediaPlayer.screenshot_raw(includes="video") - return ImageQt(im)#scale? ==QImage + temp = im.convert('RGBA') + return QtGui.QImage( + temp.tobytes('raw', "RGBA"), + temp.size[0], + temp.size[1], + QtGui.QImage.Format.Format_RGBA8888) + + #empty + #data=im.tobytes("raw","RGBA") + #qim = QtGui.QImage(data, im.size[0], im.size[1], QtGui.QImage.Format_ARGB32) + #return qim + #return ImageQt(im)#scale? ==QImage def takeScreenShot(self,path): self.mediaPlayer.screenshot_to_file(path,includes="video") diff --git a/src/lib/mpv.py b/src/lib/mpv.py index 350456c..27fed4f 100644 --- a/src/lib/mpv.py +++ b/src/lib/mpv.py @@ -17,6 +17,8 @@ # # You can find copies of the GPLv2 and LGPLv2.1 licenses in the project repository's LICENSE.GPL and LICENSE.LGPL files. +__version__ = '1.0.3' + from ctypes import * import ctypes.util import threading @@ -441,9 +443,14 @@ def text(self): return lazy_decoder(self._text) class MpvEventEndFile(Structure): - _fields_ = [('reason', c_int), - ('error', c_int)] - + _fields_ = [ + ('reason', c_int), + ('error', c_int), + ('playlist_entry_id', c_ulonglong), + ('playlist_insert_id', c_ulonglong), + ('playlist_insert_num_entries', c_int), + ] + EOF = 0 RESTARTED = 1 ABORTED = 2 @@ -1446,7 +1453,7 @@ def discnav(self, command): """Mapped mpv discnav command, see man mpv(1).""" self.command('discnav', command) - def mouse(x, y, button=None, mode='single'): + def mouse(self, x, y, button=None, mode='single'): """Mapped mpv mouse command, see man mpv(1).""" if button is None: self.command('mouse', x, y, mode)