GNOME Bugzilla – Bug 662207
gst: Fix a lot of GLib deprecations and errors
Last modified: 2012-01-23 16:12:29 UTC
see patch. Also, desrt is removing _lock_full/_unlock_full, so we have to rewrite that code there or continue using the deprecated APIs. I included an incorrect replacement, as I didn't know what was happening (I thought that gsttask created the mutex itself).
Created attachment 199445 [details] [review] gst: Fix a lot of GLib deprecations and errors https://bugs.freedesktop.org/show_bug.cgi?id=41979
Is it possible some of your #if GLIB_CHECK_VERSION() should be #if !GLIB_CHECK_VERSION() ? Unfortunately we need to maintain backwards ABI compatibility for bits in public header files (even if they're marked private, but even more importantly the structure size must not change). We can break compatibility in the 0.11 branch though.
(In reply to comment #2) > Is it possible some of your #if GLIB_CHECK_VERSION() should be #if > !GLIB_CHECK_VERSION() ? Probably. I only got so far as to say "it builds". Things like gst-base will still need fixing. > Unfortunately we need to maintain backwards ABI compatibility for bits in > public header files (even if they're marked private, but even more importantly > the structure size must not change). > > We can break compatibility in the 0.11 branch though. Then just build with deprecations on. Set -DGLIB_DISABLE_DEPRECATED_WARNINGS in your Makefile.am. When we branch, we'll revisit this.
(In reply to comment #3) > Then just build with deprecations on. Set -DGLIB_DISABLE_DEPRECATED_WARNINGS in > your Makefile.am. When we branch, we'll revisit this. Excuse me. -DGLIB_DISABLE_DEPRECATION_WARNINGS
The recursive mutex unlocking is wrong, the mutex can be locked in other places that then don't update the lock_count variable. Maybe that bit of code should be rewritten somehow, maybe with a GCond wait on the recursive mutex...
Doesn't build against current master it seems: make[4]: Entering directory `/home/kmaraas/src/gnome/gstreamer/gst' CC libgstreamer_0.10_la-gst.lo In file included from gst.h:71:0, from gst.c:117: ../gst/gsttrace.h:127:1: error: unknown type name 'GStaticMutex' make[4]: *** [libgstreamer_0.10_la-gst.lo] Error 1 make[4]: Leaving directory `/home/kmaraas/src/gnome/gstreamer/gst' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/kmaraas/src/gnome/gstreamer/gst' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/kmaraas/src/gnome/gstreamer/gst' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/kmaraas/src/gnome/gstreamer' make: *** [all] Error 2
*** Bug 662566 has been marked as a duplicate of this bug. ***
Note that this should not affect released GStreamer versions, only GStreamer git. For what it's worth, one should be able to work around it using: make GLIB_EXTRA_CFLAGS=''
> one should be able to work around it using: make > GLIB_EXTRA_CFLAGS='' Sorry, that's not actually true (it doesn't work, but also glib changed from warnings opt-in to opt-out as per comment #4).
I tried the patch in comment 1 to a fresh copy of the git/master. It doesn't apply cleanly: patching file gst/gsttaglist.c Hunk #1 FAILED at 63. Hunk #2 FAILED at 91. Hunk #3 succeeded at 1389 (offset 122 lines). Hunk #4 succeeded at 1407 (offset 122 lines). Hunk #5 succeeded at 1419 (offset 122 lines). 2 out of 5 hunks FAILED -- saving rejects to file gst/gsttaglist.c.rej [snip] patching file gst/gsttask.h patch unexpectedly ends in middle of line
Created attachment 200641 [details] [review] gst: Fix a lot of GLib deprecations and errors Yes, I ran out of steam and only fixed the main library, not anything in libs/gst/base. This patch also breaks ABI, so it will have to wait until we can break the ABI again. For now, just build with deprecations off. Do something like: make GLIB_EXTRA_CFLAGS='-UDISABLE_GLIB_DEPRECATIONS' to do that. The gsttask.c replacement is also horribly incorrect, and I knew this at the time of filing. Unfortunately, there are and will not be replacements for g_rec_mutex_lock_full g_rec_mutex_unlock_full, so someone is going to rewrite the gsttask.c code so that it doesn't play horrible hacks with locks. That someone will not be me. I'm updating this patch to apply to master, because it's an easy job, and someone can use this patch as a starting point to unbreak deprecations when ABI breaks. I'm not really a gstreamer developer, so I don't know the code that well. This is my first time ever looking at gstreamer code, actually. I just dug in and replaced gst_mutex_new with the associated equivalents.
I *think* this has mostly been taken care of now.