diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2011-10-14 15:13:20 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2011-10-15 00:54:22 +0200 |
commit | 1d0afec8fcfaca9736c927715ddd56a5902855ab (patch) | |
tree | e5c1cdad891375c7e98de9e2f67e1fc274084f66 | |
parent | bd4ebbbbed47761df65dd574dce6d3c56d29e2e7 (diff) | |
download | ffmpeg-1d0afec8fcfaca9736c927715ddd56a5902855ab.tar.gz |
ffprobe: add AVClass to writers
It is useful for logging messages from a writer context.
-rw-r--r-- | ffprobe.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -155,6 +155,19 @@ struct WriterContext { unsigned int nb_chapter; ///< number of the chapter, starting at 0 }; +static const char *writer_get_name(void *p) +{ + WriterContext *wctx = p; + return wctx->writer->name; +} + +static const AVClass writer_class = { + "Writer", + writer_get_name, + NULL, + LIBAVUTIL_VERSION_INT, +}; + static void writer_close(WriterContext **wctx) { if (*wctx && (*wctx)->writer->uninit) @@ -179,6 +192,7 @@ static int writer_open(WriterContext **wctx, const Writer *writer, goto fail; } + (*wctx)->class = &writer_class; (*wctx)->writer = writer; if ((*wctx)->writer->init) ret = (*wctx)->writer->init(*wctx, args, opaque); |