mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
testsrcbin: Plug some leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3007>
This commit is contained in:
parent
7f34b5610f
commit
19e33a6c5e
1 changed files with 10 additions and 6 deletions
|
@ -73,7 +73,6 @@ struct _GstTestSrcBin
|
||||||
GstBin parent;
|
GstBin parent;
|
||||||
|
|
||||||
gchar *uri;
|
gchar *uri;
|
||||||
GstStreamCollection *collection;
|
|
||||||
gint group_id;
|
gint group_id;
|
||||||
GstFlowCombiner *flow_combiner;
|
GstFlowCombiner *flow_combiner;
|
||||||
GstCaps *streams_def;
|
GstCaps *streams_def;
|
||||||
|
@ -266,6 +265,7 @@ gst_test_src_bin_setup_src (GstTestSrcBin * self, const gchar * srcfactory,
|
||||||
(*n_stream == 0) ? GST_STREAM_FLAG_SELECT : GST_STREAM_FLAG_UNSELECT);
|
(*n_stream == 0) ? GST_STREAM_FLAG_SELECT : GST_STREAM_FLAG_UNSELECT);
|
||||||
GstEvent *stream_start =
|
GstEvent *stream_start =
|
||||||
gst_event_new_stream_start (gst_stream_get_stream_id (stream));
|
gst_event_new_stream_start (gst_stream_get_stream_id (stream));
|
||||||
|
GstPadTemplate *templ;
|
||||||
|
|
||||||
gst_structure_foreach (props,
|
gst_structure_foreach (props,
|
||||||
(GstStructureForeachFunc) gst_test_src_bin_set_element_property, src);
|
(GstStructureForeachFunc) gst_test_src_bin_set_element_property, src);
|
||||||
|
@ -284,9 +284,10 @@ gst_test_src_bin_setup_src (GstTestSrcBin * self, const gchar * srcfactory,
|
||||||
|
|
||||||
gst_bin_add (GST_BIN (self), src);
|
gst_bin_add (GST_BIN (self), src);
|
||||||
|
|
||||||
ghost =
|
templ = gst_static_pad_template_get (template);
|
||||||
gst_ghost_pad_new_from_template (pad_name, pad,
|
ghost = gst_ghost_pad_new_from_template (pad_name, pad, templ);
|
||||||
gst_static_pad_template_get (template));
|
gst_object_unref (templ);
|
||||||
|
g_free (pad_name);
|
||||||
proxypad = GST_PAD (gst_proxy_pad_get_internal (GST_PROXY_PAD (ghost)));
|
proxypad = GST_PAD (gst_proxy_pad_get_internal (GST_PROXY_PAD (ghost)));
|
||||||
gst_flow_combiner_add_pad (self->flow_combiner, ghost);
|
gst_flow_combiner_add_pad (self->flow_combiner, ghost);
|
||||||
gst_pad_set_chain_function (proxypad,
|
gst_pad_set_chain_function (proxypad,
|
||||||
|
@ -369,8 +370,7 @@ gst_test_src_bin_create_sources (GstTestSrcBin * self)
|
||||||
self->group_id = gst_util_group_id_next ();
|
self->group_id = gst_util_group_id_next ();
|
||||||
for (i = 0; i < gst_caps_get_size (streams_def); i++) {
|
for (i = 0; i < gst_caps_get_size (streams_def); i++) {
|
||||||
GstStream *stream;
|
GstStream *stream;
|
||||||
GstStructure *stream_def =
|
GstStructure *stream_def = gst_caps_get_structure (streams_def, i);
|
||||||
gst_caps_get_structure (streams_def, i);
|
|
||||||
|
|
||||||
if ((stream =
|
if ((stream =
|
||||||
gst_test_check_prev_stream_def (self, prev_streams_def,
|
gst_test_check_prev_stream_def (self, prev_streams_def,
|
||||||
|
@ -419,6 +419,7 @@ gst_test_src_bin_create_sources (GstTestSrcBin * self)
|
||||||
|
|
||||||
gst_element_post_message (GST_ELEMENT (self),
|
gst_element_post_message (GST_ELEMENT (self),
|
||||||
gst_message_new_stream_collection (GST_OBJECT (self), collection));
|
gst_message_new_stream_collection (GST_OBJECT (self), collection));
|
||||||
|
gst_object_unref (collection);
|
||||||
|
|
||||||
gst_element_no_more_pads (GST_ELEMENT (self));
|
gst_element_no_more_pads (GST_ELEMENT (self));
|
||||||
|
|
||||||
|
@ -596,9 +597,12 @@ gst_test_src_bin_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstTestSrcBin *self = GST_TEST_SRC_BIN (object);
|
GstTestSrcBin *self = GST_TEST_SRC_BIN (object);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (gst_test_src_bin_parent_class)->finalize (object);
|
||||||
|
|
||||||
g_free (self->uri);
|
g_free (self->uri);
|
||||||
gst_clear_caps (&self->streams_def);
|
gst_clear_caps (&self->streams_def);
|
||||||
gst_flow_combiner_free (self->flow_combiner);
|
gst_flow_combiner_free (self->flow_combiner);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue