Gtkmm-forge Digest, Vol 30, Issue 4



Send Gtkmm-forge mailing list submissions to
	gtkmm-forge lists sourceforge net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/gtkmm-forge
or, via email, send a message with subject or body 'help' to
	gtkmm-forge-request lists sourceforge net

You can reach the person managing the list at
	gtkmm-forge-owner lists sourceforge net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gtkmm-forge digest..."


gtkmm-forge is the mailing list that receives gtkmm bug reports from bugzilla.  A daily digest is sent to gtkmm-main, to encourage people to help fixing the bugs. Do not try to unsubscribe gtkmm-forge from gtkmm-list.


Today's Topics:

   1. [Bug 559209] Gst::Element::get_factory() -
      Gst::ElementFactory refcount problem (gnomemm (bugzilla.gnome.org))
   2. [Bug 556570] Version 0.9.7 fails to build due to	call to
      ``GstBase::wrap_init()'' in gstreamer/gstreamermm/init.cc
      (gnomemm (bugzilla.gnome.org))
   3. [Bug 559209] Gst::Element::get_factory() -
      Gst::ElementFactory refcount problem (gnomemm (bugzilla.gnome.org))
   4. [Bug 556570] Version 0.9.7 fails to build due to	call to
      ``GstBase::wrap_init()'' in gstreamer/gstreamermm/init.cc
      (gnomemm (bugzilla.gnome.org))
   5. [Bug 559186] No LIBGTKMM_SO_VERSION update since	2.12.7
      (gtkmm (bugzilla.gnome.org))
   6. [Bug 559186] No LIBGTKMM_SO_VERSION update since	2.12.7
      (gtkmm (bugzilla.gnome.org))


----------------------------------------------------------------------

Message: 1
Date: Tue,  4 Nov 2008 23:55:24 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 559209] Gst::Element::get_factory() -
	Gst::ElementFactory refcount problem
To: gtkmm-forge lists sourceforge net
Message-ID: <20081104235524 76FDF23F512 label gnome org>
Content-Type: text/plain; charset=utf-8

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=559209

  gnomemm | gstreamermm | Ver: unspecified




------- Comment #2 from RichardF  2008-11-04 23:55 UTC -------
Thanks Murray. The code that is generated with your change to the .hg file is
exactly the (manual) workaround that I settled on while waiting for feedback on
this bug.

That said, I'm still confused about the fact that the first call to
get_factory() appears to be causing the factory to get ref'ed twice, rather
than once?

Simple test:

#include <gstreamermm.h>
#include <iostream>

int main(int argc, char* argv[])
{
    try {
        Gst::init(argc, argv);

        Glib::RefPtr<Gst::Element> element =
Gst::ElementFactory::create_element("fakesrc");

        {
            std::cout << "Getting factory" << std::endl;
            Glib::RefPtr<Gst::ElementFactory> factory = element->get_factory();
        }
        std::cout << "Factory RefPtr out of scope" << std::endl;
        {
            std::cout << "Getting factory again" << std::endl;
            Glib::RefPtr<Gst::ElementFactory> factory = element->get_factory();
            if (!factory) throw std::runtime_error("factory is NULL");
        }
        std::cout << "Second factory RefPtr out of scope" << std::endl;
        {
            std::cout << "Getting factory again" << std::endl;
            Glib::RefPtr<Gst::ElementFactory> factory = element->get_factory();
            if (!factory) throw std::runtime_error("factory is NULL");
        }
        std::cout << "Third factory RefPtr out of scope" << std::endl;
    }
    catch (...) {
        std::cout << "Uncaught exception\n";
        return 1;
    }
    std::cout << "Element RefPtr out of scope" << std::endl;

    return 0;
}


Running this prior to the bug fix will cause a failure, running with the bug
fix (and GST_DEBUG=*:5) gives me:

Getting factory
0:00:25.098267539 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:326:gst_object_ref:<fakesrc> 0x1875360 ref 1->2
0:00:25.098279077 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:380:gst_object_sink:<fakesrc> sink
0:00:25.098293597 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:326:gst_object_ref:<fakesrc> 0x1875360 ref 2->3
0:00:25.098306008 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:353:gst_object_unref:<fakesrc> 0x1875360 unref 3->2
Factory RefPtr out of scope
Getting factory again
0:00:25.098322418 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:326:gst_object_ref:<fakesrc> 0x1875360 ref 2->3
0:00:25.098332729 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:353:gst_object_unref:<fakesrc> 0x1875360 unref 3->2
Second factory RefPtr out of scope
Getting factory again
0:00:25.098347459 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:326:gst_object_ref:<fakesrc> 0x1875360 ref 2->3
0:00:25.098357584 30319      0x1716b50 LOG        GST_REFCOUNTING
gstobject.c:353:gst_object_unref:<fakesrc> 0x1875360 unref 3->2
Third factory RefPtr out of scope

ie before the first get_factory() call the factory refcount is 1, and after the
first RefPtr<ElementFactory> goes out of scope the factory refcount is 2 rather
than 1. 

All subsequent get_factory calls result in the refcount being increased by 1
only and decreased by 1, as expected, when the RefPtr goes out of scope. 

I'm relatively new to Glib style programming (and to Gstreamer for that
matter), so this different first-time code path (with the call the
gst_object_sink() - should be a no-op given the factory is owned by the
registry isn't it?) and the resulting initial double reference may be expected
behaviour, but it does seem strange to me at first glance.

My apologies if there is something basic that I'm missing???


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=559209.



------------------------------

Message: 2
Date: Wed,  5 Nov 2008 00:21:26 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 556570] Version 0.9.7 fails to build
	due to	call to ``GstBase::wrap_init()'' in
	gstreamer/gstreamermm/init.cc
To: gtkmm-forge lists sourceforge net
Message-ID: <20081105002126 CCAF323F51E label gnome org>
Content-Type: text/plain; charset=utf-8

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=556570

  gnomemm | gstreamermm | Ver: unspecified




------- Comment #12 from Deng Xiyue  2008-11-05 00:21 UTC -------
(In reply to comment #11)
> Closed then. Deng, do tell us if this is a serious problem for you.
> 

Not at all, and it'll be helpful to have it documented to avoid further
misunderstanding.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=556570.



------------------------------

Message: 3
Date: Wed,  5 Nov 2008 00:21:26 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 559209] Gst::Element::get_factory() -
	Gst::ElementFactory refcount problem
To: gtkmm-forge lists sourceforge net
Message-ID: <20081105002126 BFCF823F51C label gnome org>
Content-Type: text/plain; charset=utf-8

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=559209

  gnomemm | gstreamermm | Ver: unspecified




------- Comment #3 from Murray Cumming  2008-11-05 00:21 UTC -------
That debug output is not at all clear to me. I am not convinced that it means
what you think it means.

The function is incredibly simple:

GstElementFactory *
gst_element_get_factory (GstElement * element)
{
  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);

  return GST_ELEMENT_GET_CLASS (element)->elementfactory;
}

It does no referencing, so we must take a reference when creating a RefPtr from
its result. We then release that refernce in the RefPtr destructor. I don't see
how any different refcounting could happen the first or second time that this
function is called.

If you are not convinced, you should probably try creating a C test case.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=559209.



------------------------------

Message: 4
Date: Wed,  5 Nov 2008 00:51:22 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 556570] Version 0.9.7 fails to build
	due to	call to ``GstBase::wrap_init()'' in
	gstreamer/gstreamermm/init.cc
To: gtkmm-forge lists sourceforge net
Message-ID: <20081105005122 B008A23F514 label gnome org>
Content-Type: text/plain; charset=utf-8

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=556570

  gnomemm | gstreamermm | Ver: unspecified




------- Comment #13 from Deng Xiyue  2008-11-05 00:50 UTC -------
Created an attachment (id=121989)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=121989&action=view)
gstreamermm-ldflags.patch

Proposed patch, please modify it if it should be documented elsewhere.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=556570.



------------------------------

Message: 5
Date: Wed,  5 Nov 2008 01:48:35 +0000 (UTC)
From: "gtkmm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 559186] No LIBGTKMM_SO_VERSION update
	since	2.12.7
To: gtkmm-forge lists sourceforge net
Message-ID: <20081105014835 1CDE723F512 label gnome org>
Content-Type: text/plain; charset=utf-8

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=559186

  gtkmm | build | Ver: 2.14.x

Mart Raudsepp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |leio gentoo org




------- Comment #2 from Mart Raudsepp  2008-11-05 01:48 UTC -------
GTK+ definitely changes. 2.14.4 is .so.0.1400.4 in the end result, 2.14.3 was
.so.0.1400.3, 2.12.12 was .so.0.1200.12, etc. What mostly matter is ABI breaks
where problems happen - but the problem is the ABI break itself, not proper
reflection of it.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=559186.



------------------------------

Message: 6
Date: Wed,  5 Nov 2008 02:44:20 +0000 (UTC)
From: "gtkmm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 559186] No LIBGTKMM_SO_VERSION update
	since	2.12.7
To: gtkmm-forge lists sourceforge net
Message-ID: <20081105024420 0950923F512 label gnome org>
Content-Type: text/plain; charset=utf-8

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=559186

  gtkmm | build | Ver: 2.14.x




------- Comment #3 from Murray Cumming  2008-11-05 02:44 UTC -------
We don't break ABI.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=559186.



------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

------------------------------

_______________________________________________
Gtkmm-forge mailing list
Gtkmm-forge lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/gtkmm-forge


End of Gtkmm-forge Digest, Vol 30, Issue 4
******************************************


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]