Hello all,
I am looking for some help getting the object GdkPixbuf from gdkpixbufsink. I am working in image processing so I want to get the image buffer for each frame. My priorities are to have a reliable and conceptually simple way of getting the buffer. I have started by modifying gst-player-0.0.0, changed it to use the gdkpixbufsink sink and waiting to process messages on the bus. I am seeing the element/pixbuf messages without a problem. I then call the following on the bus message: buff = gst_structure_get_value (msg->structure,"pixbuf"); which gives me a non-zero pointer. I was expecting that is a GdkPixbuf object. The problem I get is when I do GDK_IS_PIXBUF(buff) it returns false. Any ideas why? Or am I meant to retrieve "last-pixbuf" from the sink directly? If more detail is needed, the code is here: http://www.sheerman-chase.org.uk/temp/gst-player-pixel.tar.gz Tim ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
On Fri, 2009-01-09 at 17:17 +0000, [hidden email] wrote:
Hi, > I have started by modifying gst-player-0.0.0, changed it to use the > gdkpixbufsink sink and waiting to process messages on the bus. I am > seeing the element/pixbuf messages without a problem. I then call the > following on the bus message: > > buff = gst_structure_get_value (msg->structure,"pixbuf"); > > which gives me a non-zero pointer. I was expecting that is a GdkPixbuf > object. The problem I get is when I do GDK_IS_PIXBUF(buff) it returns > false. Any ideas why? It returns a const GValue * from which you can retrieve the GdkPixbuf object via pixbuf = g_value_dup_object (val); (which gives you a reference to the pixbuf which you need to drop with g_object_unref(pixbuf) when you don't need it any longer) > Or am I meant to retrieve "last-pixbuf" from the sink directly? You can do that as well. The "last-pixbuf" property is useful if you want to check the pixbuf in your own time/interval and you're just interested in the current pixbuf and not interested whether you're missing any or not. If you want to evaluate each and every pixbuf, you need to process the messages. There's also an example at: http://webcvs.freedesktop.org/gstreamer/gst-plugins-good/tests/icles/gdkpixbufsink-test.c?view=markup Cheers -Tim ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |