From c759878707c65a0130dcd132f7b185d62a0d7bf1 Mon Sep 17 00:00:00 2001 From: Miqra Developer Date: Thu, 27 Sep 2018 20:44:48 +0000 Subject: [PATCH] Added code to replage glimagesink library on install and restor it on uninstall --- .gitignore | 2 ++ debian/postinst | 4 ++++ debian/prerm | 2 ++ glimagesink_BUILD.txt | 9 +++++++++ {glimagesink_bin => glimagesink_so}/libgstopengl.so | Bin VERSION.py => mediaserver/VERSION.py | 2 +- setup.py | 4 ++-- test_client.py | 2 +- 8 files changed, 21 insertions(+), 4 deletions(-) mode change 100644 => 100755 debian/prerm create mode 100644 glimagesink_BUILD.txt rename {glimagesink_bin => glimagesink_so}/libgstopengl.so (100%) rename VERSION.py => mediaserver/VERSION.py (81%) diff --git a/.gitignore b/.gitignore index 8cbe41e..2dc22bd 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +MANIFEST +dist/ .vs/ build/ deb_dist/ diff --git a/debian/postinst b/debian/postinst index 1f861a5..579798c 100755 --- a/debian/postinst +++ b/debian/postinst @@ -21,6 +21,10 @@ set -e case "$1" in configure) update-rc.d mediaserver defaults + # backup old library file + cp /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstopengl.so /usr/share/mediaserver/glimagesink_so/libgstopengl.so.old + # copy new library file + cp /usr/share/mediaserver/glimagesink_so/libgstopengl.so /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstopengl.so ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/prerm b/debian/prerm old mode 100644 new mode 100755 index 73f3269..fc9c61e --- a/debian/prerm +++ b/debian/prerm @@ -20,6 +20,8 @@ set -e case "$1" in remove|upgrade|deconfigure) update-rc.d -f mediaserver remove + # replaceold library file + cp /usr/share/mediaserver/glimagesink_so/libgstopengl.so.old /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstopengl.so ;; failed-upgrade) diff --git a/glimagesink_BUILD.txt b/glimagesink_BUILD.txt new file mode 100644 index 0000000..f67b13b --- /dev/null +++ b/glimagesink_BUILD.txt @@ -0,0 +1,9 @@ +Instructions used to build noX port of glimagesink plugin: + +Using source of gestreamer 1.10.5 + +./configure --disable-gtk-doc --disable-x11 --disable-glx --enable-egl --enable-dispmanx CFLAGS="-I/opt/vc/include/EGL -I/opt/vc/include/GLES -I/opt/vc/include/GLES2 -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux" LDFLAGS="-L/opt/vc/lib" CPPFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/EGL" --with-gles2-module-name=/opt/vc/lib/libbrcmGLESv2.so --with-egl-module-name=/opt/vc/lib/libbrcmEGL.so +make +cp ext/gl/.libs/libgstopengl.so ~/.local/share/gstreamer-1.0/plugins/libgstopengl.so + + diff --git a/glimagesink_bin/libgstopengl.so b/glimagesink_so/libgstopengl.so similarity index 100% rename from glimagesink_bin/libgstopengl.so rename to glimagesink_so/libgstopengl.so diff --git a/VERSION.py b/mediaserver/VERSION.py similarity index 81% rename from VERSION.py rename to mediaserver/VERSION.py index e5b4cc4..e05fe9f 100755 --- a/VERSION.py +++ b/mediaserver/VERSION.py @@ -1,6 +1,6 @@ major=1 # Major version -minor=1 # Minor version +minor=2 # Minor version micro=0 # Bugfix version # code to generate version string from above data diff --git a/setup.py b/setup.py index ef304da..d6e2e11 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ Includes scheduled recorder, music player, sound level meter and a webcam viewer from distutils.core import setup from distutils.extension import Extension from glob import glob -import VERSION +from mediaserver import VERSION # patch distutils if it's too old to cope with the "classifiers" or # "download_url" keywords @@ -48,6 +48,6 @@ if __name__ == '__main__': ('/etc/init.d', glob('etc/init.d/*')), ('bin', glob('bin/*')), ('sbin', glob('sbin/*')), - + ('/usr/share/mediaserver/glimagesink_so',glob('glimagesink_so/*')), ], ) diff --git a/test_client.py b/test_client.py index 45e3e87..d6d17a5 100755 --- a/test_client.py +++ b/test_client.py @@ -30,7 +30,7 @@ class TestController: GObject.timeout_add(10, self.tick) def tick(self): - self.player.QuickLoop("/opt/src/robotvideo/ogen open.mp4",5) + self.player.QuickLoop("/opt/src/robotvideo/ogen open.mp4") #GObject.timeout_add(3000, self.reboot) pass