GNOME Bugzilla – Bug 691484
osxvideosink: crash when displaying on Qt widget
Last modified: 2013-01-23 10:40:43 UTC
I suffer some strange crash in showFrame() obj-C method of GstOSXVideoSinkObject in osxvideosink when frames are being displayed on external view (in my case, Qt4 widget). Crash report is attached. The good news is that a modified example qt-overlay.c from gst-plugin-base package apparently works fine. I'll try to get test program reproducing the crash tomorrow, but maybe you would suggest some potential reasons meanwhile. Here's main differences of my program compared to test program: 1. As Qt4 don't use Glib mainloop in Mac OS X I have to rotate it manually, so effectively there're two main loops running, though Glib one seems to be rotating only in main thread, so there should be no problems. 2. Data is streaming from appsrc and not videotestsrc. 3. I use autovideosink so window-id is set using sync handler (we discussed it with Sebastian in bug #691421, I fixed my code according to GSTXOverlay example). Window-id is already obtained by the time of bus message posting, so there's no any call to Qt stuff, it's just int assignment. Another strange fact is that _sometimes_ the program works successfully the very first time after I rebuild and refresh osxvideosink. But second and futher executes crash. osxvideosink version is latest git one from 0.10 branch.
Created attachment 233157 [details] Mac crash report
Created attachment 233158 [details] Modified test program which apparently works fine
I seem to find the problem, it's essentially in GstOSXVideoSinkObject::resize() method which a) calls internal window method setContentSize while internal window wasn't created if window-id was set immediately (actually my bug as I posted a patch for this method some time ago, sorry) and b) doesn't call setVideoSize method for gstview so texture buffer has old size, in case it's smaller than new one this leads to crash with SIGBUS or SIGSEGV. I think I'll create a patch later today.
Created attachment 233222 [details] [review] Patch addressing the crash
Review of attachment 233222 [details] [review]: Could you attach the patch as created by "git format-patch"? Looks good other than that
Created attachment 233238 [details] [review] git format-patch version of the previous patch Yes, sure. Here it is. Thank you for reviewing!
commit dc276a7c2a909edca365f91d6ee434747ae5cf66 Author: Alexey Chernov <achernov@neosphere.com> Date: Fri Jan 11 19:24:43 2013 +0400 osxvideosink: Fix crash in osxvideosink with external window output