mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
discoverer: improve logging (and reindent)
Add more logging for the tag merging and use the _OBJECT flavour more.
This commit is contained in:
parent
140dca43f3
commit
c201ff3de3
1 changed files with 25 additions and 13 deletions
|
@ -396,12 +396,16 @@ _event_probe (GstPad * pad, GstEvent * event, PrivateStream * ps)
|
||||||
/* If preroll is complete, drop these tags - the collected information is
|
/* If preroll is complete, drop these tags - the collected information is
|
||||||
* possibly already being processed and adding more tags would be racy */
|
* possibly already being processed and adding more tags would be racy */
|
||||||
if (G_LIKELY (ps->dc->priv->processing)) {
|
if (G_LIKELY (ps->dc->priv->processing)) {
|
||||||
|
GST_DEBUG_OBJECT (pad, "private stream %p old tags %" GST_PTR_FORMAT, ps,
|
||||||
|
ps->tags);
|
||||||
tmp = gst_tag_list_merge (ps->tags, tl, GST_TAG_MERGE_APPEND);
|
tmp = gst_tag_list_merge (ps->tags, tl, GST_TAG_MERGE_APPEND);
|
||||||
if (ps->tags)
|
if (ps->tags)
|
||||||
gst_tag_list_free (ps->tags);
|
gst_tag_list_free (ps->tags);
|
||||||
ps->tags = tmp;
|
ps->tags = tmp;
|
||||||
|
GST_DEBUG_OBJECT (pad, "private stream %p new tags %" GST_PTR_FORMAT, ps,
|
||||||
|
tmp);
|
||||||
} else
|
} else
|
||||||
GST_DEBUG_OBJECT (ps->dc, "Dropping tags since preroll is done");
|
GST_DEBUG_OBJECT (pad, "Dropping tags since preroll is done");
|
||||||
DISCO_UNLOCK (ps->dc);
|
DISCO_UNLOCK (ps->dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -844,10 +848,14 @@ parse_stream_topology (GstDiscoverer * dc, const GstStructure * topology,
|
||||||
if (gst_structure_id_has_field (topology, _TAGS_QUARK)) {
|
if (gst_structure_id_has_field (topology, _TAGS_QUARK)) {
|
||||||
gst_structure_id_get (topology, _TAGS_QUARK,
|
gst_structure_id_get (topology, _TAGS_QUARK,
|
||||||
GST_TYPE_STRUCTURE, &tags, NULL);
|
GST_TYPE_STRUCTURE, &tags, NULL);
|
||||||
|
|
||||||
|
GST_DEBUG ("Merge tags %" GST_PTR_FORMAT, tags);
|
||||||
|
|
||||||
cont->parent.tags =
|
cont->parent.tags =
|
||||||
gst_tag_list_merge (cont->parent.tags, (GstTagList *) tags,
|
gst_tag_list_merge (cont->parent.tags, (GstTagList *) tags,
|
||||||
GST_TAG_MERGE_APPEND);
|
GST_TAG_MERGE_APPEND);
|
||||||
gst_tag_list_free (tags);
|
gst_tag_list_free (tags);
|
||||||
|
GST_DEBUG ("Container info tags %" GST_PTR_FORMAT, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
@ -965,7 +973,8 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||||
{
|
{
|
||||||
gboolean done = FALSE;
|
gboolean done = FALSE;
|
||||||
|
|
||||||
GST_DEBUG ("got a %s message", GST_MESSAGE_TYPE_NAME (msg));
|
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg), "got a %s message",
|
||||||
|
GST_MESSAGE_TYPE_NAME (msg));
|
||||||
|
|
||||||
switch (GST_MESSAGE_TYPE (msg)) {
|
switch (GST_MESSAGE_TYPE (msg)) {
|
||||||
case GST_MESSAGE_ERROR:{
|
case GST_MESSAGE_ERROR:{
|
||||||
|
@ -973,8 +982,8 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||||
gchar *debug;
|
gchar *debug;
|
||||||
|
|
||||||
gst_message_parse_error (msg, &gerr, &debug);
|
gst_message_parse_error (msg, &gerr, &debug);
|
||||||
GST_WARNING ("Got an error [debug:%s]", debug);
|
GST_WARNING_OBJECT (GST_MESSAGE_SRC (msg),
|
||||||
GST_WARNING ("Got an error [message:%s]", gerr->message);
|
"Got an error [debug:%s], [message:%s]", debug, gerr->message);
|
||||||
dc->priv->current_error = gerr;
|
dc->priv->current_error = gerr;
|
||||||
g_free (debug);
|
g_free (debug);
|
||||||
|
|
||||||
|
@ -1005,7 +1014,8 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||||
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
|
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
|
||||||
"structure %" GST_PTR_FORMAT, msg->structure);
|
"structure %" GST_PTR_FORMAT, msg->structure);
|
||||||
if (sttype == _MISSING_PLUGIN_QUARK) {
|
if (sttype == _MISSING_PLUGIN_QUARK) {
|
||||||
GST_DEBUG ("Setting result to MISSING_PLUGINS");
|
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
|
||||||
|
"Setting result to MISSING_PLUGINS");
|
||||||
dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
|
dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
|
||||||
dc->priv->current_info->misc = gst_structure_copy (msg->structure);
|
dc->priv->current_info->misc = gst_structure_copy (msg->structure);
|
||||||
} else if (sttype == _STREAM_TOPOLOGY_QUARK) {
|
} else if (sttype == _STREAM_TOPOLOGY_QUARK) {
|
||||||
|
@ -1019,7 +1029,7 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||||
GstTagList *tl, *tmp;
|
GstTagList *tl, *tmp;
|
||||||
|
|
||||||
gst_message_parse_tag (msg, &tl);
|
gst_message_parse_tag (msg, &tl);
|
||||||
GST_DEBUG ("Got tags %" GST_PTR_FORMAT, tl);
|
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg), "Got tags %" GST_PTR_FORMAT, tl);
|
||||||
/* Merge with current tags */
|
/* Merge with current tags */
|
||||||
tmp =
|
tmp =
|
||||||
gst_tag_list_merge (dc->priv->current_info->tags, tl,
|
gst_tag_list_merge (dc->priv->current_info->tags, tl,
|
||||||
|
@ -1028,6 +1038,8 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||||
if (dc->priv->current_info->tags)
|
if (dc->priv->current_info->tags)
|
||||||
gst_tag_list_free (dc->priv->current_info->tags);
|
gst_tag_list_free (dc->priv->current_info->tags);
|
||||||
dc->priv->current_info->tags = tmp;
|
dc->priv->current_info->tags = tmp;
|
||||||
|
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg), "Current info %p, tags %"
|
||||||
|
GST_PTR_FORMAT, dc->priv->current_info, tmp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue