History

avcodec/bsf: Beautify log messages from bitstream filters

Up until now, the name of every AVBSFContext for logging purposes was "AVBSFContext", so that the default logging callback produced output like "[AVBSFContext @ 0x55813bae92c0] Extradata". This has been changed to "[trace_headers @ 0x60a000000700] Extradata" by adding an item_name- function to the AVClass for bitstream filters. Furthermore, the correct category has been set so that the introductory part before the actual message (everything before "Extradata" in the above examples) are displayed in a different colour than the rest.

Andreas Rheinhardt committed 6 years ago

Commit ea46b451 parent d0ba6711 file · +7 −1Browse files

Unified · Split

libavcodec/bsf.c+7−1
@@ -64,12 +64,18 @@ static void *bsf_child_next(void *obj, void *prev) · 63 unmodified lines
64 return NULL;64 return NULL;
65}65}
66 66
67static const char *bsf_to_name(void *bsf)
68{
69 return ((AVBSFContext *)bsf)->filter->name;
70}
71
67static const AVClass bsf_class = {72static const AVClass bsf_class = {
68 .class_name = "AVBSFContext",73 .class_name = "AVBSFContext",
69 .item_name = av_default_item_name,74 .item_name = bsf_to_name,
70 .version = LIBAVUTIL_VERSION_INT,75 .version = LIBAVUTIL_VERSION_INT,
71 .child_next = bsf_child_next,76 .child_next = bsf_child_next,
72 .child_class_next = ff_bsf_child_class_next,77 .child_class_next = ff_bsf_child_class_next,
78 .category = AV_CLASS_CATEGORY_BITSTREAM_FILTER,
73};79};
74 80
75const AVClass *av_bsf_get_class(void)81const AVClass *av_bsf_get_class(void)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t