source = gst_bin_get_by_name (GST_BIN (data->sink), "testsource");
fail_unless (gst_app_src_end_of_stream (GST_APP_SRC (source)) ==
GST_FLOW_OK);
+ gst_object_unref (source);
break;
case GST_MESSAGE_ERROR:
g_main_loop_quit (data->loop);
GstSample *sample;
GstBuffer *app_buffer, *buffer;
GstElement *source;
+ GstFlowReturn ret;
/* get the sample from appsink */
sample = gst_app_sink_pull_sample (GST_APP_SINK (elt));
/* get source an push new buffer */
source = gst_bin_get_by_name (GST_BIN (data->sink), "testsource");
- return gst_app_src_push_buffer (GST_APP_SRC (source), app_buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (source), app_buffer);
+ gst_object_unref (source);
+
+ return ret;
}
/* called when we get a GstMessage from the source pipeline when we get EOS, we
g_print ("The source got dry\n");
source = gst_bin_get_by_name (GST_BIN (data->sink), "testsource");
gst_app_src_end_of_stream (GST_APP_SRC (source));
+ gst_object_unref (source);
break;
case GST_MESSAGE_ERROR:
g_print ("Received error\n");
gtk_main ();
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
+ gst_object_unref (bus);
return 0;
}
gtk_main ();
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
+ gst_object_unref (bus);
return 0;
}
/* set the active pad */
g_object_set (select, "active-pad", pad, NULL);
+ gst_object_unref (select);
return TRUE;
}
g_print ("NULL pipeline\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
+ gst_object_unref (bus);
+
g_print ("free pipeline\n");
gst_object_unref (pipeline);
/* get the preroll buffer from appsink, this block untils appsink really
* prerolls */
g_signal_emit_by_name (sink, "pull-preroll", &sample, NULL);
+ gst_object_unref (sink);
/* if we have a buffer now, convert it to a pixbuf. It's possible that we
* don't have a buffer because we went EOS right away or had an error. */
g_main_loop_unref (loop);
+ gst_object_unref (bus);
+
return 0;
}
}
}
+ gst_object_unref (toverlay);
g_free (pstr);
}