From 03f9ca3d640cc2163275c075c82e8f44d60d965a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 17 May 2011 12:51:34 +0200 Subject: [PATCH] encodebin: Update for caps/pad template related API changes --- gst/encoding/gstencodebin.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c index 39ce74bee3..6b2355b80a 100644 --- a/gst/encoding/gstencodebin.c +++ b/gst/encoding/gstencodebin.c @@ -869,7 +869,7 @@ gst_element_get_pad_from_template (GstElement * element, GstPadTemplate * templ) /* FIXME : Improve algorithm for finding compatible muxer sink pad */ static inline GstPad * get_compatible_muxer_sink_pad (GstEncodeBin * ebin, GstElement * encoder, - const GstCaps * sinkcaps) + GstCaps * sinkcaps) { GstPad *sinkpad; GstPadTemplate *srctempl = NULL; @@ -887,10 +887,11 @@ get_compatible_muxer_sink_pad (GstEncodeBin * ebin, GstElement * encoder, gst_object_unref (srcpad); sinktempl = gst_element_get_compatible_pad_template (ebin->muxer, srctempl); + gst_object_unref (srctempl); } else { srctempl = gst_pad_template_new ("whatever", GST_PAD_SRC, GST_PAD_ALWAYS, - gst_caps_copy (sinkcaps)); + sinkcaps); g_assert (srctempl != NULL); sinktempl = gst_element_get_compatible_pad_template (ebin->muxer, srctempl); g_object_unref (srctempl); @@ -926,8 +927,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof, /* Element we will link to the encoder */ GstElement *last = NULL; GList *tmp, *tosync = NULL; - const GstCaps *format; - const GstCaps *restriction; + GstCaps *format, *restriction; const gchar *missing_element_name; format = gst_encoding_profile_get_format (sprof); @@ -1294,6 +1294,11 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof, ebin->streams = g_list_prepend (ebin->streams, sgroup); + if (format) + gst_caps_unref (format); + if (restriction) + gst_caps_unref (restriction); + return sgroup; splitter_encoding_failure: @@ -1368,6 +1373,10 @@ converter_link_failure: cleanup: /* FIXME : Actually properly cleanup everything */ + if (format) + gst_caps_unref (format); + if (restriction) + gst_caps_unref (restriction); g_slice_free (StreamGroup, sgroup); return NULL; }