diff options
author | James Almer <jamrial@gmail.com> | 2019-01-26 06:41:35 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-01-28 18:16:54 +0300 |
commit | c98bbeb3cf7ec6bd2545fdb8704dae87fe7cc117 (patch) | |
tree | 11593a76dff62fd870f78ebf772a67b84145cf73 /include/dav1d/dav1d.h | |
parent | 0749f4b0929bf9e4f0afa5bc96a12073b55a2408 (diff) |
add a logging callback mechanism
Diffstat (limited to 'include/dav1d/dav1d.h')
-rw-r--r-- | include/dav1d/dav1d.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/dav1d/dav1d.h b/include/dav1d/dav1d.h index 15365e1..82f0a2c 100644 --- a/include/dav1d/dav1d.h +++ b/include/dav1d/dav1d.h @@ -33,6 +33,7 @@ extern "C" { #endif #include <errno.h> +#include <stdarg.h> #include "common.h" #include "picture.h" @@ -44,10 +45,23 @@ typedef struct Dav1dRef Dav1dRef; #define DAV1D_MAX_FRAME_THREADS 256 #define DAV1D_MAX_TILE_THREADS 64 +typedef struct Dav1dLogger { + void *cookie; ///< Custom data to pass to the callback. + /** + * Logger callback. Default prints to stderr. May be NULL to disable logging. + * + * @param cookie Custom pointer passed to all calls. + * @param format The vprintf compatible format string. + * @param ap List of arguments referenced by the format string. + */ + void (*callback)(void *cookie, const char *format, va_list ap); +} Dav1dLogger; + typedef struct Dav1dSettings { int n_frame_threads; int n_tile_threads; Dav1dPicAllocator allocator; + Dav1dLogger logger; int apply_grain; int operating_point; ///< select an operating point for scalable AV1 bitstreams (0 - 31) int all_layers; ///< output all spatial layers of a scalable AV1 biststream |