[FFmpeg-cvslog] ffprobe: add AVClass to writers

Stefano Sabatini git at videolan.org
Sat Oct 15 00:57:52 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Oct 14 15:13:20 2011 +0200| [1d0afec8fcfaca9736c927715ddd56a5902855ab] | committer: Stefano Sabatini

ffprobe: add AVClass to writers

It is useful for logging messages from a writer context.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d0afec8fcfaca9736c927715ddd56a5902855ab
---

 ffprobe.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index a2a6dac..593d369 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -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);



More information about the ffmpeg-cvslog mailing list