Fixed minor leak in examples/util

Fixed minor pipeline/element memory leak in examples/util
This commit is contained in:
rob-deutsch
2019-02-10 18:07:09 +11:00
committed by Rob Deutsch
parent 434af9e0e8
commit 72c51607d7
2 changed files with 2 additions and 0 deletions

View File

@@ -57,5 +57,6 @@ void gstreamer_receive_push_buffer(GstElement *pipeline, void *buffer, int len)
gpointer p = g_memdup(buffer, len); gpointer p = g_memdup(buffer, len);
GstBuffer *buffer = gst_buffer_new_wrapped(p, len); GstBuffer *buffer = gst_buffer_new_wrapped(p, len);
gst_app_src_push_buffer(GST_APP_SRC(src), buffer); gst_app_src_push_buffer(GST_APP_SRC(src), buffer);
gst_object_unref(src);
} }
} }

View File

@@ -76,6 +76,7 @@ void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) {
GstElement *appsink = gst_bin_get_by_name(GST_BIN(pipeline), "appsink"); GstElement *appsink = gst_bin_get_by_name(GST_BIN(pipeline), "appsink");
g_object_set(appsink, "emit-signals", TRUE, NULL); g_object_set(appsink, "emit-signals", TRUE, NULL);
g_signal_connect(appsink, "new-sample", G_CALLBACK(gstreamer_send_new_sample_handler), s); g_signal_connect(appsink, "new-sample", G_CALLBACK(gstreamer_send_new_sample_handler), s);
gst_object_unref(appsink);
gst_element_set_state(pipeline, GST_STATE_PLAYING); gst_element_set_state(pipeline, GST_STATE_PLAYING);
} }