mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
ffprobe: add AVClass to writers
It is useful for logging messages from a writer context.
This commit is contained in:
parent
bd4ebbbbed
commit
1d0afec8fc
14
ffprobe.c
14
ffprobe.c
@ -155,6 +155,19 @@ struct WriterContext {
|
|||||||
unsigned int nb_chapter; ///< number of the chapter, starting at 0
|
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)
|
static void writer_close(WriterContext **wctx)
|
||||||
{
|
{
|
||||||
if (*wctx && (*wctx)->writer->uninit)
|
if (*wctx && (*wctx)->writer->uninit)
|
||||||
@ -179,6 +192,7 @@ static int writer_open(WriterContext **wctx, const Writer *writer,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(*wctx)->class = &writer_class;
|
||||||
(*wctx)->writer = writer;
|
(*wctx)->writer = writer;
|
||||||
if ((*wctx)->writer->init)
|
if ((*wctx)->writer->init)
|
||||||
ret = (*wctx)->writer->init(*wctx, args, opaque);
|
ret = (*wctx)->writer->init(*wctx, args, opaque);
|
||||||
|
Loading…
Reference in New Issue
Block a user