-
Notifications
You must be signed in to change notification settings - Fork 82
patches for (1) broken videoflip method and (2) broken ximagesink in GStreamer 1.22.0
- A regression that broke user setting of "videoflip" was introduced in GStreamer-plugins-good v. 1.22.0
- new features (touchscreen support) in "ximagesink" also introduce a bug that produces a segmentation fault at least on Raspberry Pi
- note: the latest version UxPlay-1.68.3 has a modernized videoflip support that does not need gstreamer-1.22.0 to be patched.
The problem appeared in GStreamer-1.22.0, and was first fixed in 1.22.3. Evidently this did not completely solve all related issues, as versions of an additional fix were merged 3 times, becoming stable in 1.22.6
The patch here includes all these fixes, and can be applied to gstreamer-plugins-good 1.22.0, 1.22.1, and 1.22.2
- The problem also affects Ubuntu 23.04 which provides GStreamer 1.22.1 (but not Ubuntu 23.10, which supplies the fully-fixed GStreamer-1.22.6)
References:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/b17fbb231cde6fd72e356daa43122084693fef7d
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/2dc0e1ac877c7122ff57d557395f768dbc7ec55a
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/4c77bc21617d3717bcd677d1fd3dce71713edb2b
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/bbca6cc8c8125f53b74f7b9a5b7a559595f9cf89
The patch is:
https://github.com/FDH2/UxPlay/files/14551547/gst_videoflip_1_22_0_diff.txt
The changes in GStreamer-1.22 to ximagesink videosink (but not the better xvimagesink videosink with XV support) needs a one-line fix to correct a missing initialization which causes a segmentation fault on some systems, when ximagesink starts rendering video. No patch is supplied, but you can fix it by editing line 587 of gst-plugins-base/sysximage/ximagesink.c: ( change "unsigned char mask[2];
" to
"unsigned char mask[2] = {0};
". The bug is now fixed in GStreamer 1.22.10 and later, and 1.24.3 and later.
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6631/diffs
-
Edit
/etc/apt/sources.list
to uncomment the deb-src items (use an editor like nano with sudo:sudo nano /etc/apt/sources.list
) and save the changes. -
sudo apt update
-
sudo apt install devscripts
-
install the build dependencies for the packages to be patched:
sudo apt build-dep gstreamer1.0-plugins-<name>
, whereplugins-<name>
is "plugins-good" for the videoflip fix, and "plugins-base" for the ximagesink fix. -
Now create a directory in your user space where you will rebuild the package, and cd to it. For the videoflip fix, get the patch:
wget https://github.com/FDH2/UxPlay/files/14551547/gst_videoflip_1_22_0_diff.txt
6 Then, without using sudo, apt source gstreamer1.0-plugins-<name>
, and then cd gst-plugins*-1.22.0
, followed by debuild
. Wait while debuild rebuilds the package; ignore any error messages. When it stops, you can optionally verify that it rebuilt correctly with: cd obj* ; ninja ; cd ..
. This should give the response "ninja: no work to do".
- Now (a) apply the patch (videoflip) or (b) edit the source (ximagesink):
patch -p1 < ../gst_videoflip_1_22_0_diff.txt
or
nano sys/ximage/ximagesink.c
now go to line 587 (with "^/587 followed by [enter], ^ = Ctrl key), change unsigned char mask[2];
in line 587 to unsigned char mask[2] = {0};
, then exit, saving your changes.
-
cd obj*; ninja
-
This will build the fixed library. Then for the videoflip fix
cd gst/videofilter
and for the ximagesink fix,cd sys/ximage
. -
now
strip *.so
andsudo cp libgst<name>.so /usr/<libdir>/gstreamer-1.0/
where<name>
is either "videofilter" or "ximagesink" and<libdir>
is either "aarch64-linux-gnu" (64 bit systems) or "arm-linux-gnueabihf" (32 bit systems).