<div>Hi, <br/>
<br/>
Here's what I usually do to troubleshoot assertions like those. Build your app and related packages with debugging symbols enabled, and run it like:<br/>
<br/>
ulimit -c unlimited<br/>
G_DEBUG=fatal_warnings ./app <br/>
<br/>
That will generate a core dump when an assertion is failed, which you can analyze with GDB or alike. <br/>
<br/>
Michael<br/><br/>-----Original Message-----<br/>From: d <dudi017@gmail.com><br/>To: gstreamer-devel@lists.freedesktop.org<br/>Sent: Fri, 31 Jan 2014 19:10<br/>Subject: streamer inside thread<br/><br/></div>Hi,
<br/>
<br/>
Im trying to transmit video from thread.
<br/>
the program works perfectly if I put it outside the thread, but once I put
<br/>
it inside the thread, im getting this error:
<br/>
<br/>
(program:<a href="tel:14481">14481</a>): GStreamer-CRITICAL **: gst_mini_object_unref: assertion
<br/>
`GST_IS_MINI_OBJECT (mini_object)' failed
<br/>
<br/>
(program:<a href="tel:14481">14481</a>): GLib-GObject-CRITICAL **: g_object_unref: assertion
<br/>
`G_IS_OBJECT (object)' failed
<br/>
<br/>
<br/>
this is the content of the thread: (im kind of sure that the problem is with
<br/>
---> gst_init (&rcvStruct.argc, &rcvStruct.argv); )
<br/>
<br/>
void *RTPfun(void * rcv) //rcv is struct that contain argc, argv, and
<br/>
some IP address
<br/>
{
<br/>
struct multiple_var rcvStruct =*(struct multiple_var *) rcv;
<br/>
char *IP= (char*)rcvStruct.client_addr;
<br/>
<br/>
GstElement *pipeline, *src, *encoder, *parse, *rtp, *sink;
<br/>
GstBus *bus;
<br/>
GstMessage *msg;
<br/>
GstStateChangeReturn ret;
<br/>
GMainLoop *loop;
<br/>
<br/>
printf("argc: %d\n",rcvStruct.argc);
<br/>
//gst_init (&argc, &argv);
<br/>
gst_init (&rcvStruct.argc, &rcvStruct.argv);
<br/>
printf("RTPthread: client IP: %s\n",IP);
<br/>
<br/>
free (rcv);
<br/>
<br/>
src = gst_element_factory_make ("videotestsrc", "src"); //v4l2src
<br/>
encoder = gst_element_factory_make ("x264enc","encoder");
<br/>
rtp = gst_element_factory_make ("rtph264pay", "rtp");
<br/>
sink = gst_element_factory_make ("udpsink", "sink");
<br/>
<br/>
pipeline = gst_pipeline_new ("test-pipeline");
<br/>
<br/>
if (!pipeline) g_printerr ("Not pipeline.\n");
<br/>
if (!src) g_printerr ("Not src.\n");
<br/>
if (!encoder) g_printerr ("Not encoder.\n");
<br/>
if (!rtp) g_printerr ("Not rtp.\n");
<br/>
if (!sink) g_printerr ("Not sink.\n");
<br/>
<br/>
g_object_set(G_OBJECT(sink),"host",IP,NULL);
<br/>
g_object_set(G_OBJECT(sink),"port",5000,NULL);
<br/>
<br/>
// Build the pipeline
<br/>
gst_bin_add_many (GST_BIN (pipeline), src, encoder, rtp, sink, NULL);
<br/>
if (gst_element_link_many (src, encoder, rtp, sink, NULL) != TRUE) {
<br/>
g_printerr ("Elements could not be linked.\n");
<br/>
gst_object_unref (pipeline);
<br/>
return 0;//-1
<br/>
}
<br/>
<br/>
<br/>
// Start playing
<br/>
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
<br/>
if (ret == GST_STATE_CHANGE_FAILURE) {
<br/>
g_printerr ("Unable to set the pipeline to the playing state.\n");
<br/>
gst_object_unref (pipeline);
<br/>
return 0;//-1
<br/>
}
<br/>
<br/>
<br/>
// Parse message
<br/>
if (msg != NULL) {
<br/>
GError *err;
<br/>
gchar *debug_info;
<br/>
<br/>
switch (GST_MESSAGE_TYPE (msg)) {
<br/>
case GST_MESSAGE_ERROR:
<br/>
gst_message_parse_error (msg, &err, &debug_info);
<br/>
g_printerr ("Error received from element %s: %s\n", GST_OBJECT_NAME
<br/>
(msg->src), err->message);
<br/>
g_printerr ("Debugging information: %s\n", debug_info ? debug_info :
<br/>
"none");
<br/>
g_clear_error (&err);
<br/>
g_free (debug_info);
<br/>
break;
<br/>
case GST_MESSAGE_EOS:
<br/>
g_print ("End-Of-Stream reached.\n");
<br/>
break;
<br/>
default:
<br/>
//We should not reach here because we only asked for ERRORs and EOS
<br/>
g_printerr ("Unexpected message received.\n");
<br/>
break;
<br/>
}
<br/>
gst_message_unref (msg);
<br/>
}
<br/>
<br/>
<br/>
gst_object_unref (bus);
<br/>
gst_element_set_state (pipeline, GST_STATE_NULL);
<br/>
gst_object_unref (pipeline);
<br/>
g_printerr("finished\n");
<br/>
<br/>
<br/>
return 0;
<br/>
}
<br/>
<br/>
<br/>
If someone know what to do it will be great!
<br/>
thanks.
<br/>
<br/>
<br/>
<br/>
--
<br/>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/streamer-inside-thread-tp4665006.html">http://gstreamer-devel.966125.n4.nabble.com/streamer-inside-thread-tp4665006.html</a>
<br/>
Sent from the GStreamer-devel mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.
<br/>
_______________________________________________
<br/>
gstreamer-devel mailing list
<br/>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<br/>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
<br/>