summaryrefslogtreecommitdiff
path: root/libavutil/log.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-01-22 02:41:54 +0100
committerDiego Biurrun <diego@biurrun.de>2013-03-13 20:42:06 +0100
commitf099d3d1d5466bd63f4ab36270d169ff9ea613b8 (patch)
tree2ab260e6b16efde06b2909b28cf1013aa46b8f1f /libavutil/log.c
parent4abf6fa095f8082499d5a24cdfb18eb4c1fec60e (diff)
Add av_log_{ask_for_sample|missing_feature} replacements to libavutil
This allows reporting missing features and requesting samples from all libraries in a standard way; with a simplified API.
Diffstat (limited to 'libavutil/log.c')
-rw-r--r--libavutil/log.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/libavutil/log.c b/libavutil/log.c
index 80129769f6..bd46b0c054 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -32,10 +32,12 @@
#if HAVE_IO_H
#include <io.h>
#endif
+#include <stdarg.h>
#include <stdlib.h>
#include "avstring.h"
#include "avutil.h"
#include "common.h"
+#include "internal.h"
#include "log.h"
static int av_log_level = AV_LOG_INFO;
@@ -179,3 +181,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 Libav "
+ "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.libav.org/incoming/ "
+ "and contact the libav-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);
+}