rsvgdec: add some minimal logging to track what it is doing

This commit is contained in:
Stefan Kost 2010-11-08 15:45:48 +02:00
parent 6428d306ea
commit 9ddeba2407

View file

@ -188,6 +188,8 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
gdouble scalex, scaley;
const gchar *title = NULL, *comment = NULL;
GST_LOG_OBJECT (rsvg, "parsing svg");
handle = rsvg_handle_new_from_data (data, size, &error);
if (!handle) {
GST_ERROR_OBJECT (rsvg, "Failed to parse SVG image: %s", error->message);
@ -199,6 +201,8 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
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 ();
@ -215,6 +219,8 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
GstCaps *caps1, *caps2, *caps3;
GstStructure *s;
GST_LOG_OBJECT (rsvg, "resolution changed, updating caps");
caps1 = gst_caps_copy (gst_pad_get_pad_template_caps (rsvg->srcpad));
caps2 = gst_pad_peer_get_caps (rsvg->srcpad);
if (caps2) {
@ -280,6 +286,8 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
return ret;
}
GST_LOG_OBJECT (rsvg, "render image at %d x %d", rsvg->height, rsvg->width);
surface =
cairo_image_surface_create_for_data (GST_BUFFER_DATA (*buffer),
CAIRO_FORMAT_ARGB32, rsvg->width, rsvg->height, rsvg->width * 4);
@ -348,6 +356,8 @@ gst_rsvg_dec_chain (GstPad * pad, GstBuffer * buffer)
if (completed) {
GstBuffer *outbuf = NULL;
GST_LOG_OBJECT (rsvg, "have complete svg of %u bytes", size);
data = gst_adapter_peek (rsvg->adapter, size);
ret = gst_rsvg_decode_image (rsvg, data, size, &outbuf);
@ -387,6 +397,8 @@ gst_rsvg_dec_chain (GstPad * pad, GstBuffer * buffer)
rsvg->pending_tags = NULL;
}
GST_LOG_OBJECT (rsvg, "image rendered okay");
ret = gst_pad_push (rsvg->srcpad, outbuf);
if (ret != GST_FLOW_OK)
break;