mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
jpeg: comment and logging changes
This commit is contained in:
parent
824364d152
commit
b67454b44e
3 changed files with 23 additions and 11 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -186,6 +186,8 @@ validate_taglist_foreach (const GstTagList * list, const gchar * tag,
|
|||
const GValue *val1 = gst_tag_list_get_value_index (list, tag, 0);
|
||||
const GValue *val2 = gst_tag_list_get_value_index (other, tag, 0);
|
||||
|
||||
GST_DEBUG ("checking tag '%s'", tag);
|
||||
|
||||
fail_if (val1 == NULL);
|
||||
fail_if (val2 == NULL);
|
||||
|
||||
|
@ -421,6 +423,7 @@ validity_bus_cb (GstBus * bus, GstMessage * message, gpointer data)
|
|||
} else {
|
||||
tags_found = taglist;
|
||||
}
|
||||
GST_DEBUG ("tags: %" GST_PTR_FORMAT, tags_found);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue