[gst-devel] Freeing application data from message
Albert Costa
costa_albert at yahoo.fr
Mon Jul 5 14:11:42 CEST 2010
Hi,
I have a plugin that generates custom application messages to be sent on the bus:
///////////
//INSIDE MY PLUGIN
GstMessage* msg;
GstStructure* structure;
GstBus* bus = gst_element_get_bus(GST_ELEMENT(filter));
MyInfo* myinfo = new MyInfo;
/* do stuff with myinfo, including allocating internal data */
structure = gst_structure_new("FILTERMESSAGE",
"info", G_TYPE_POINTER, (gpointer)myinfo,
NULL);
msg = gst_message_new_application(NULL,structure);
gst_bus_post (bus, msg);
On the other side, I have my application that watches the bus messages, and gets my info:
case GST_MESSAGE_APPLICATION:
const GstStructure *structure = gst_message_get_structure(message);
MyInfo* info;
info = (MyInfo*)g_value_get_pointer(gst_structure_get_value(structure, "info"));
All this works fine, but how can I free the resources allocated in myinfo structure? I can't release the strcuture that is owned by message, and I try to unref the message in the application then I get a
CRITICAL **: file ..\..\..\Source\gstreamer\gst\gstminiobject.c: line 359: assertion `mini_object->refcount > 0' failed
So how can I release my data?
Regards,
Al
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100705/171503a9/attachment.htm>
More information about the gstreamer-devel
mailing list