From 27cab67b50baa7e0811b4686df5ffa3c29c5250f Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 2 Jul 2015 10:34:06 +0100 Subject: [PATCH] gst-thumbnailer: Add more debug output https://bugzilla.xfce.org/show_bug.cgi?id=12042 --- plugins/gst-thumbnailer/gst-thumbnailer.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/gst-thumbnailer/gst-thumbnailer.c b/plugins/gst-thumbnailer/gst-thumbnailer.c index 284a0b9..1f31e4c 100644 --- a/plugins/gst-thumbnailer/gst-thumbnailer.c +++ b/plugins/gst-thumbnailer/gst-thumbnailer.c @@ -151,8 +151,10 @@ gst_thumbnailer_cover_from_tags (GstTagList *tags, break; /* look for image in the tags */ - if (!gst_tag_list_get_sample_index (tags, GST_TAG_IMAGE, i, &sample)) + if (!gst_tag_list_get_sample_index (tags, GST_TAG_IMAGE, i, &sample)) { + g_debug ("%s: Failed to get sample index", G_STRFUNC); break; + } caps = gst_sample_get_caps (sample); caps_struct = gst_caps_get_structure (caps, 0); @@ -161,6 +163,7 @@ gst_thumbnailer_cover_from_tags (GstTagList *tags, GST_TYPE_TAG_IMAGE_TYPE, &type); + g_debug ("%s: Got type %u", G_STRFUNC, type); if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER) { /* found the cover */ @@ -175,9 +178,12 @@ gst_thumbnailer_cover_from_tags (GstTagList *tags, && !g_cancellable_is_cancelled (cancellable)) { /* look for preview image */ + g_debug ("%s: Failed to find sample cover; trying preview image", G_STRFUNC); gst_tag_list_get_sample_index (tags, GST_TAG_PREVIEW_IMAGE, 0, &cover); } + g_debug ("%s: Got cover %p", G_STRFUNC, cover); + if (cover != NULL) { /* create image */ @@ -199,7 +205,9 @@ gst_thumbnailer_cover_by_name (GstElement *play, GstTagList *tags = NULL; GdkPixbuf *cover; + g_debug ("%s: Emitting signal %s", G_STRFUNC, signal_name); g_signal_emit_by_name (G_OBJECT (play), signal_name, 0, &tags); + g_debug ("%s: Got tags %p", G_STRFUNC, tags); if (tags == NULL) return FALSE; @@ -583,6 +591,8 @@ gst_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, /* check for covers in the file */ pixbuf = gst_thumbnailer_cover (play, cancellable); + g_debug ("%s: Got cover pixbuf %p", G_STRFUNC, pixbuf); + /* extract cover from video stream */ if (pixbuf == NULL && gst_thumbnailer_has_video (play)) @@ -595,6 +605,7 @@ gst_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, duration = -1; pixbuf = gst_thumbnailer_capture_interesting_frame (play, duration, width, cancellable); + g_debug ("%s: Got frame pixbuf %p", G_STRFUNC, pixbuf); } } @@ -602,6 +613,8 @@ gst_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, gst_element_set_state (play, GST_STATE_NULL); g_object_unref (play); + g_debug ("%s: Got overall pixbuf %p", G_STRFUNC, pixbuf); + if (G_LIKELY (pixbuf != NULL)) { /* scale to correct size if required */ @@ -625,6 +638,9 @@ gst_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, if (error != NULL) { + g_debug ("%s: Error saving thumbnail for ā€˜%s’: %s", + G_STRFUNC, tumbler_file_info_get_uri (info), + error->message); g_signal_emit_by_name (thumbnailer, "error", tumbler_file_info_get_uri (info), error->code, error->message); @@ -632,6 +648,8 @@ gst_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, } else { + g_debug ("%s: Saved thumbnail for ā€˜%s’", G_STRFUNC, + tumbler_file_info_get_uri (info)); g_signal_emit_by_name (thumbnailer, "ready", tumbler_file_info_get_uri (info)); } -- 2.4.3