mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
rsvgdec: add some minimal logging to track what it is doing
This commit is contained in:
parent
6428d306ea
commit
9ddeba2407
1 changed files with 12 additions and 0 deletions
|
@ -188,6 +188,8 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
|
||||||
gdouble scalex, scaley;
|
gdouble scalex, scaley;
|
||||||
const gchar *title = NULL, *comment = NULL;
|
const gchar *title = NULL, *comment = NULL;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (rsvg, "parsing svg");
|
||||||
|
|
||||||
handle = rsvg_handle_new_from_data (data, size, &error);
|
handle = rsvg_handle_new_from_data (data, size, &error);
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
GST_ERROR_OBJECT (rsvg, "Failed to parse SVG image: %s", error->message);
|
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);
|
comment = rsvg_handle_get_desc (handle);
|
||||||
|
|
||||||
if (title || comment) {
|
if (title || comment) {
|
||||||
|
GST_LOG_OBJECT (rsvg, "adding tags");
|
||||||
|
|
||||||
if (!rsvg->pending_tags)
|
if (!rsvg->pending_tags)
|
||||||
rsvg->pending_tags = gst_tag_list_new ();
|
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;
|
GstCaps *caps1, *caps2, *caps3;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (rsvg, "resolution changed, updating caps");
|
||||||
|
|
||||||
caps1 = gst_caps_copy (gst_pad_get_pad_template_caps (rsvg->srcpad));
|
caps1 = gst_caps_copy (gst_pad_get_pad_template_caps (rsvg->srcpad));
|
||||||
caps2 = gst_pad_peer_get_caps (rsvg->srcpad);
|
caps2 = gst_pad_peer_get_caps (rsvg->srcpad);
|
||||||
if (caps2) {
|
if (caps2) {
|
||||||
|
@ -280,6 +286,8 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, const guint8 * data, guint size,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (rsvg, "render image at %d x %d", rsvg->height, rsvg->width);
|
||||||
|
|
||||||
surface =
|
surface =
|
||||||
cairo_image_surface_create_for_data (GST_BUFFER_DATA (*buffer),
|
cairo_image_surface_create_for_data (GST_BUFFER_DATA (*buffer),
|
||||||
CAIRO_FORMAT_ARGB32, rsvg->width, rsvg->height, rsvg->width * 4);
|
CAIRO_FORMAT_ARGB32, rsvg->width, rsvg->height, rsvg->width * 4);
|
||||||
|
@ -348,6 +356,8 @@ gst_rsvg_dec_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
if (completed) {
|
if (completed) {
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (rsvg, "have complete svg of %u bytes", size);
|
||||||
|
|
||||||
data = gst_adapter_peek (rsvg->adapter, size);
|
data = gst_adapter_peek (rsvg->adapter, size);
|
||||||
|
|
||||||
ret = gst_rsvg_decode_image (rsvg, data, size, &outbuf);
|
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;
|
rsvg->pending_tags = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (rsvg, "image rendered okay");
|
||||||
|
|
||||||
ret = gst_pad_push (rsvg->srcpad, outbuf);
|
ret = gst_pad_push (rsvg->srcpad, outbuf);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue