It will be used for logging, possibly also AVOptions.
Showing the changes to libavfilter/avfiltergraph.c (1 of 3 files). Show all
Unified · Split
| @@ -27,9 +27,23 @@ · 26 unmodified lines | ||
| 27 | 27 | #include "avfiltergraph.h" |
| 28 | 28 | #include "internal.h" |
| 29 | 29 | |
| 30 | +#include "libavutil/log.h" | |
| 31 | + | |
| 32 | +static const AVClass filtergraph_class = { | |
| 33 | + .class_name = "AVFilterGraph", | |
| 34 | + .item_name = av_default_item_name, | |
| 35 | + .version = LIBAVUTIL_VERSION_INT, | |
| 36 | +}; | |
| 37 | + | |
| 30 | 38 | AVFilterGraph *avfilter_graph_alloc(void) |
| 31 | 39 | { |
| 32 | − return av_mallocz(sizeof(AVFilterGraph)); | |
| 40 | + AVFilterGraph *ret = av_mallocz(sizeof(AVFilterGraph)); | |
| 41 | + if (!ret) | |
| 42 | + return NULL; | |
| 43 | +#if FF_API_GRAPH_AVCLASS | |
| 44 | + ret->av_class = &filtergraph_class; | |
| 45 | +#endif | |
| 46 | + return ret; | |
| 33 | 47 | } |
| 34 | 48 | |
| 35 | 49 | void avfilter_graph_free(AVFilterGraph **graph) |