summaryrefslogtreecommitdiff
path: root/gst/jpegformat
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2011-04-11 18:29:28 +0300
committerStefan Kost <ensonic@users.sf.net>2011-04-11 18:29:28 +0300
commitb67454b44edadd59515d062360a0f4e86e7ed6d6 (patch)
treee875601d3fafbff1738e7ccc79bf770e26c834d6 /gst/jpegformat
parent824364d152dbac2039e2bf39bbcdb25434297fc7 (diff)
downloadgstreamer-plugins-bad-b67454b44edadd59515d062360a0f4e86e7ed6d6.tar.gz
jpeg: comment and logging changes
Diffstat (limited to 'gst/jpegformat')
-rw-r--r--gst/jpegformat/gstjifmux.c9
-rw-r--r--gst/jpegformat/gstjpegparse.c22
2 files changed, 20 insertions, 11 deletions
diff --git a/gst/jpegformat/gstjifmux.c b/gst/jpegformat/gstjifmux.c
index e8e2c6e76..fcb2df02c 100644
--- a/gst/jpegformat/gstjifmux.c
+++ b/gst/jpegformat/gstjifmux.c
@@ -387,8 +387,8 @@ gst_jif_mux_mangle_markers (GstJifMux * self)
/* update the APP markers
* - put any JFIF APP0 first
- * - the Exif APP1 next,
- * - the XMP APP1 next,
+ * - the Exif APP1 next,
+ * - the XMP APP1 next,
* - the PSIR APP13 next,
* - followed by all other marker segments
*/
@@ -587,7 +587,7 @@ gst_jif_mux_mangle_markers (GstJifMux * self)
memcpy (&data[29], xmp, size);
m = gst_jif_mux_new_marker (APP1, size + 29, data, TRUE);
- /*
+ /*
* Replace the old xmp marker and not add a new one.
* There shouldn't be a xmp packet in the input, but it is better
* to be safe than add another one and end up with 2 packets.
@@ -611,12 +611,13 @@ gst_jif_mux_mangle_markers (GstJifMux * self)
modified = TRUE;
}
- /* add jpeg comment */
+ /* add jpeg comment from any of those */
(void) (gst_tag_list_get_string (tags, GST_TAG_COMMENT, &str) ||
gst_tag_list_get_string (tags, GST_TAG_DESCRIPTION, &str) ||
gst_tag_list_get_string (tags, GST_TAG_TITLE, &str));
if (str) {
+ GST_DEBUG_OBJECT (self, "set COM marker to '%s'", str);
/* insert new marker into self->markers list */
m = gst_jif_mux_new_marker (COM, strlen (str) + 1, (const guint8 *) str,
TRUE);
diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c
index cfe5c2e6d..47114465b 100644
--- a/gst/jpegformat/gstjpegparse.c
+++ b/gst/jpegformat/gstjpegparse.c
@@ -550,14 +550,17 @@ gst_jpeg_parse_skip_marker (GstJpegParse * parse,
if (marker >= APP0 && marker <= APP15) {
const gchar *id_str = NULL;
- if (!gst_byte_reader_peek_string_utf8 (reader, &id_str))
- return FALSE;
-
- GST_LOG_OBJECT (parse, "unhandled marker %x: '%s' skiping %u bytes",
- marker, id_str ? id_str : "(NULL)", size);
+ if (gst_byte_reader_peek_string_utf8 (reader, &id_str)) {
+ GST_DEBUG_OBJECT (parse, "unhandled marker %x: '%s' skiping %u bytes",
+ marker, id_str ? id_str : "(NULL)", size);
+ } else {
+ GST_DEBUG_OBJECT (parse, "unhandled marker %x skiping %u bytes", marker,
+ size);
+ }
}
#else
- GST_LOG_OBJECT (parse, "unhandled marker %x skiping %u bytes", marker, size);
+ GST_DEBUG_OBJECT (parse, "unhandled marker %x skiping %u bytes", marker,
+ size);
#endif // GST_DISABLE_DEBUG
if (!gst_byte_reader_skip (reader, size - 2))
@@ -596,6 +599,8 @@ extract_and_queue_tags (GstJpegParse * parse, guint size, guint8 * data,
} else {
parse->priv->tags = tags;
}
+ GST_DEBUG_OBJECT (parse, "collected tags: %" GST_PTR_FORMAT,
+ parse->priv->tags);
}
}
@@ -685,6 +690,7 @@ gst_jpeg_parse_com (GstJpegParse * parse, GstByteReader * reader)
GstTagList *taglist = get_tag_list (parse);
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
GST_TAG_COMMENT, comment, NULL);
+ GST_DEBUG_OBJECT (parse, "collected tags: %" GST_PTR_FORMAT, taglist);
g_free (comment);
}
@@ -861,7 +867,8 @@ gst_jpeg_parse_push_buffer (GstJpegParse * parse, guint len)
}
if (parse->priv->tags) {
- GST_DEBUG_OBJECT (parse, "Pushing tags");
+ GST_DEBUG_OBJECT (parse, "Pushing tags: %" GST_PTR_FORMAT,
+ parse->priv->tags);
gst_element_found_tags_for_pad (GST_ELEMENT_CAST (parse),
parse->priv->srcpad, parse->priv->tags);
parse->priv->tags = NULL;
@@ -981,6 +988,7 @@ gst_jpeg_parse_sink_event (GstPad * pad, GstEvent * event)
/* Hold on to the tags till the srcpad caps are definitely set */
gst_tag_list_insert (get_tag_list (parse), taglist,
GST_TAG_MERGE_REPLACE);
+ GST_DEBUG ("collected tags: %" GST_PTR_FORMAT, parse->priv->tags);
gst_event_unref (event);
}
break;