gst-plugins-bad: rsvg: Stop using deprecated API when compiling with RSVG 2 .35.0 or newer

Sebastian Dröge slomo at kemper.freedesktop.org
Wed Apr 25 02:50:59 PDT 2012


Module: gst-plugins-bad
Branch: master
Commit: a04d8a0d42c477b852a7f0d41b1ff3daedf38322
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=a04d8a0d42c477b852a7f0d41b1ff3daedf38322

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Wed Apr 25 11:50:15 2012 +0200

rsvg: Stop using deprecated API when compiling with RSVG 2.35.0 or newer

---

 configure.ac          |    8 +++++++-
 ext/rsvg/gstrsvg.c    |    2 ++
 ext/rsvg/gstrsvgdec.c |   28 ----------------------------
 ext/rsvg/gstrsvgdec.h |    1 -
 4 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7d10f91..c8d2a2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1495,7 +1495,13 @@ AG_GST_CHECK_FEATURE(PVR, [pvrvideosink], pvr, [
 dnl *** rsvg ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_RSVG, true)
 AG_GST_CHECK_FEATURE(RSVG, [rsvg decoder], rsvg, [
-  PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= 2.14 cairo, HAVE_RSVG="yes", [
+  PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= 2.14 cairo, [
+    HAVE_RSVG="yes"
+    PKG_CHECK_MODULES(RSVG_2_35_0, librsvg-2.0 >= 2.35.0, HAVE_RSVG_2_35_0="yes", HAVE_RSVG_2_35_0="no")
+    if test "x$HAVE_RSVG_2_35_0" = "xyes"; then
+      AC_DEFINE(HAVE_RSVG_2_35_0, [1], [Have RSVG 2.35.0 or newer])
+    fi
+  ], [
     HAVE_RSVG="no"
   ])
   AC_SUBST(RSVG_CFLAGS)
diff --git a/ext/rsvg/gstrsvg.c b/ext/rsvg/gstrsvg.c
index 0e18110..fe1bc44 100644
--- a/ext/rsvg/gstrsvg.c
+++ b/ext/rsvg/gstrsvg.c
@@ -29,7 +29,9 @@
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
+#ifndef HAVE_RSVG_2_35_0
   rsvg_init ();
+#endif
 
   return (gst_element_register (plugin, "rsvgoverlay",
           GST_RANK_NONE, GST_TYPE_RSVG_OVERLAY)
diff --git a/ext/rsvg/gstrsvgdec.c b/ext/rsvg/gstrsvgdec.c
index f7cb701..13b7baa 100644
--- a/ext/rsvg/gstrsvgdec.c
+++ b/ext/rsvg/gstrsvgdec.c
@@ -150,11 +150,6 @@ gst_rsvg_dec_reset (GstRsvgDec * dec)
   g_list_foreach (dec->pending_events, (GFunc) gst_mini_object_unref, NULL);
   g_list_free (dec->pending_events);
   dec->pending_events = NULL;
-
-  if (dec->pending_tags) {
-    gst_tag_list_free (dec->pending_tags);
-    dec->pending_tags = NULL;
-  }
 }
 
 #define CAIRO_UNPREMULTIPLY(a,r,g,b) G_STMT_START { \
@@ -198,7 +193,6 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
   GError *error = NULL;
   RsvgDimensionData dimension;
   gdouble scalex, scaley;
-  const gchar *title = NULL, *comment = NULL;
 
   GST_LOG_OBJECT (rsvg, "parsing svg");
 
@@ -209,23 +203,6 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
     return GST_FLOW_ERROR;
   }
 
-  title = rsvg_handle_get_title (handle);
-  comment = rsvg_handle_get_desc (handle);
-
-  if (title || comment) {
-    GST_LOG_OBJECT (rsvg, "adding tags");
-
-    if (!rsvg->pending_tags)
-      rsvg->pending_tags = gst_tag_list_new ();
-
-    if (title && *title)
-      gst_tag_list_add (rsvg->pending_tags, GST_TAG_MERGE_REPLACE_ALL,
-          GST_TAG_TITLE, title, NULL);
-    if (comment && *comment)
-      gst_tag_list_add (rsvg->pending_tags, GST_TAG_MERGE_REPLACE_ALL,
-          GST_TAG_COMMENT, comment, NULL);
-  }
-
   rsvg_handle_get_dimensions (handle, &dimension);
   if (rsvg->width != dimension.width || rsvg->height != dimension.height) {
     GstCaps *caps1, *caps2, *caps3;
@@ -429,11 +406,6 @@ gst_rsvg_dec_chain (GstPad * pad, GstBuffer * buffer)
         rsvg->pending_events = NULL;
       }
 
-      if (rsvg->pending_tags) {
-        gst_element_found_tags (GST_ELEMENT_CAST (rsvg), rsvg->pending_tags);
-        rsvg->pending_tags = NULL;
-      }
-
       GST_LOG_OBJECT (rsvg, "image rendered okay");
 
       ret = gst_pad_push (rsvg->srcpad, outbuf);
diff --git a/ext/rsvg/gstrsvgdec.h b/ext/rsvg/gstrsvgdec.h
index 0d048ee..540f93d 100644
--- a/ext/rsvg/gstrsvgdec.h
+++ b/ext/rsvg/gstrsvgdec.h
@@ -55,7 +55,6 @@ struct _GstRsvgDec
   gint width, height;
 
   GList *pending_events;
-  GstTagList *pending_tags;
 
   gint fps_n, fps_d;
   GstClockTime first_timestamp;



More information about the gstreamer-commits mailing list