diff options
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/internal.h | 21 | ||||
-rw-r--r-- | libavutil/log.c | 39 |
2 files changed, 60 insertions, 0 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index a105fe6b44..6ff14facb5 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -162,4 +162,25 @@ # define ONLY_IF_THREADS_ENABLED(x) NULL #endif +/** + * Log a generic warning message about a missing feature. + * + * @param[in] avc a pointer to an arbitrary struct of which the first + * field is a pointer to an AVClass struct + * @param[in] msg string containing the name of the missing feature + */ +void avpriv_report_missing_feature(void *avc, + const char *msg, ...) av_printf_format(2, 3); + +/** + * Log a generic warning message about a missing feature. + * Additionally request that a sample showcasing the feature be uploaded. + * + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] msg string containing the name of the missing feature + */ +void avpriv_request_sample(void *avc, + const char *msg, ...) av_printf_format(2, 3); + #endif /* AVUTIL_INTERNAL_H */ diff --git a/libavutil/log.c b/libavutil/log.c index 700e89fa97..a27413444d 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -32,9 +32,11 @@ #if HAVE_IO_H #include <io.h> #endif +#include <stdarg.h> #include <stdlib.h> #include "avutil.h" #include "common.h" +#include "internal.h" #include "log.h" #define LINE_SZ 1024 @@ -278,3 +280,40 @@ void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)) { av_log_callback = callback; } + +static void missing_feature_sample(int sample, void *avc, const char *msg, ...) +{ + va_list argument_list; + + va_start(argument_list, msg); + + av_vlog(avc, AV_LOG_WARNING, msg, argument_list); + av_log(avc, AV_LOG_WARNING, " is not implemented. Update your FFmpeg " + "version to the newest one from Git. If the problem still " + "occurs, it means that your file has a feature which has not " + "been implemented.\n"); + if (sample) + av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample " + "of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ " + "and contact the ffmpeg-devel mailing list.\n"); + + va_end(argument_list); +} + +void avpriv_request_sample(void *avc, const char *msg, ...) +{ + va_list argument_list; + + va_start(argument_list, msg); + missing_feature_sample(1, avc, msg, argument_list); + va_end(argument_list); +} + +void avpriv_report_missing_feature(void *avc, const char *msg, ...) +{ + va_list argument_list; + + va_start(argument_list, msg); + missing_feature_sample(0, avc, msg, argument_list); + va_end(argument_list); +} |