After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691484 - osxvideosink: crash when displaying on Qt widget
osxvideosink: crash when displaying on Qt widget
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.36
Other Mac OS
: Normal major
: 1.0.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-10 16:45 UTC by Alexey Chernov
Modified: 2013-01-23 10:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mac crash report (59.00 KB, application/octet-stream)
2013-01-10 16:46 UTC, Alexey Chernov
  Details
Modified test program which apparently works fine (3.53 KB, application/octet-stream)
2013-01-10 16:47 UTC, Alexey Chernov
  Details
Patch addressing the crash (1.41 KB, patch)
2013-01-11 12:03 UTC, Alexey Chernov
needs-work Details | Review
git format-patch version of the previous patch (1.63 KB, patch)
2013-01-11 15:31 UTC, Alexey Chernov
committed Details | Review

Description Alexey Chernov 2013-01-10 16:45:56 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.
Comment 1 Alexey Chernov 2013-01-10 16:46:33 UTC
Created attachment 233157 [details]
Mac crash report
Comment 2 Alexey Chernov 2013-01-10 16:47:19 UTC
Created attachment 233158 [details]
Modified test program which apparently works fine
Comment 3 Alexey Chernov 2013-01-11 09:00:15 UTC
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.
Comment 4 Alexey Chernov 2013-01-11 12:03:29 UTC
Created attachment 233222 [details] [review]
Patch addressing the crash
Comment 5 Sebastian Dröge (slomo) 2013-01-11 14:16:03 UTC
Review of attachment 233222 [details] [review]:

Could you attach the patch as created by "git format-patch"? Looks good other than that
Comment 6 Alexey Chernov 2013-01-11 15:31:13 UTC
Created attachment 233238 [details] [review]
git format-patch version of the previous patch

Yes, sure. Here it is. Thank you for reviewing!
Comment 7 Sebastian Dröge (slomo) 2013-01-16 10:44:36 UTC
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