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 662207 - gst: Fix a lot of GLib deprecations and errors
gst: Fix a lot of GLib deprecations and errors
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal critical
: 0.11.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 662566 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-10-19 15:13 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-01-23 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst: Fix a lot of GLib deprecations and errors (52.84 KB, patch)
2011-10-19 15:13 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
gst: Fix a lot of GLib deprecations and errors (51.72 KB, patch)
2011-11-03 19:36 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-10-19 15:13:17 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).
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-10-19 15:13:19 UTC
Created attachment 199445 [details] [review]
gst: Fix a lot of GLib deprecations and errors

https://bugs.freedesktop.org/show_bug.cgi?id=41979
Comment 2 Tim-Philipp Müller 2011-10-19 15:27:04 UTC
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.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-10-19 15:50:26 UTC
(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.
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-10-19 15:50:53 UTC
(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
Comment 5 Wim Taymans 2011-10-19 16:01:21 UTC
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...
Comment 6 Kjartan Maraas 2011-10-23 10:33:08 UTC
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
Comment 7 David King 2011-10-24 12:41:24 UTC
*** Bug 662566 has been marked as a duplicate of this bug. ***
Comment 8 Tim-Philipp Müller 2011-10-31 17:18:06 UTC
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=''
Comment 9 Tim-Philipp Müller 2011-10-31 17:41:15 UTC
> 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).
Comment 10 David Ronis 2011-10-31 18:05:59 UTC
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
Comment 11 Jasper St. Pierre (not reading bugmail) 2011-11-03 19:36:06 UTC
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.
Comment 12 Tim-Philipp Müller 2012-01-23 16:12:29 UTC
I *think* this has mostly been taken care of now.