debug: Use log contexts in some places
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6855>
This commit is contained in:
parent
c796abbf0a
commit
feb3df61a7
@ -1255,6 +1255,10 @@ gst_pb_utils_add_codec_description_to_tag_list (GstTagList * taglist,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GST_LOG_CONTEXT_STATIC_DEFINE (unexisting_media_type_log_context,
|
||||
GST_LOG_CONTEXT_FLAG_THROTTLE);
|
||||
#define UNEXISTING_MEDIA_TYPE_LOG_CONTEXT GST_LOG_CONTEXT_LAZY_INIT(unexisting_media_type_log_context)
|
||||
|
||||
/**
|
||||
* gst_pb_utils_get_codec_description:
|
||||
* @caps: the (fixed) #GstCaps for which an format description is needed
|
||||
@ -1296,7 +1300,8 @@ gst_pb_utils_get_codec_description (const GstCaps * caps)
|
||||
* audio/, video/, image/ and application/ prefixes etc. */
|
||||
}
|
||||
|
||||
GST_WARNING ("No description available for media type: %s", str);
|
||||
GST_CTX_WARNING (UNEXISTING_MEDIA_TYPE_LOG_CONTEXT,
|
||||
"No description available for media type: %s", str);
|
||||
}
|
||||
gst_caps_unref (tmp);
|
||||
|
||||
|
@ -56,8 +56,16 @@
|
||||
/* For g_stat () */
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
GST_DEBUG_CATEGORY_STATIC (discoverer_debug);
|
||||
#define GST_CAT_DEFAULT discoverer_debug
|
||||
|
||||
GST_LOG_CONTEXT_STATIC_DEFINE (warning_message_log_ctx, GST_LOG_CONTEXT_FLAG_THROTTLE,
|
||||
GST_LOG_CONTEXT_BUILDER_SET_HASH_FLAGS(GST_LOG_CONTEXT_USE_STRING_ARGS);
|
||||
);
|
||||
#define WARNING_MESSAGE_LOG_CTX GST_LOG_CONTEXT_LAZY_INIT (warning_message_log_ctx)
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#define CACHE_DIRNAME "discoverer"
|
||||
|
||||
typedef struct
|
||||
@ -1613,7 +1621,7 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
|
||||
gchar *debug = NULL;
|
||||
|
||||
gst_message_parse_warning (msg, &err, &debug);
|
||||
GST_WARNING_OBJECT (GST_MESSAGE_SRC (msg),
|
||||
GST_CTX_WARNING_OBJECT (WARNING_MESSAGE_LOG_CTX, GST_MESSAGE_SRC (msg),
|
||||
"Got a warning [debug:%s], [message:%s]", debug, err->message);
|
||||
g_clear_error (&err);
|
||||
g_free (debug);
|
||||
|
@ -993,6 +993,9 @@ do_async_done (GstURIDecodeBin * dbin)
|
||||
#define DEFAULT_QUEUE_MIN_THRESHOLD ((DEFAULT_QUEUE_SIZE * 30) / 100)
|
||||
#define DEFAULT_QUEUE_THRESHOLD ((DEFAULT_QUEUE_SIZE * 95) / 100)
|
||||
|
||||
GST_LOG_CONTEXT_STATIC_DEFINE (no_decoder_for_type_log_context,
|
||||
GST_LOG_CONTEXT_FLAG_THROTTLE);
|
||||
#define NO_DECODER_FOR_TYPE_LOG_CTX GST_LOG_CONTEXT_LAZY_INIT(no_decoder_for_type_log_context)
|
||||
static void
|
||||
unknown_type_cb (GstElement * element, GstPad * pad, GstCaps * caps,
|
||||
GstURIDecodeBin * decoder)
|
||||
@ -1000,7 +1003,8 @@ unknown_type_cb (GstElement * element, GstPad * pad, GstCaps * caps,
|
||||
gchar *capsstr;
|
||||
|
||||
capsstr = gst_caps_to_string (caps);
|
||||
GST_ELEMENT_WARNING (decoder, STREAM, CODEC_NOT_FOUND,
|
||||
GST_ELEMENT_WARNING_WITH_LOG_CTX (decoder, STREAM, CODEC_NOT_FOUND,
|
||||
NO_DECODER_FOR_TYPE_LOG_CTX,
|
||||
(_("No decoder available for type \'%s\'."), capsstr), (NULL));
|
||||
g_free (capsstr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user