#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#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;
static int flags;
-#if defined(_WIN32) && !defined(__MINGW32CE__)
+#if HAVE_SETCONSOLETEXTATTRIBUTE
#include <windows.h>
-#include <io.h>
static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 };
static int16_t background, attr_orig;
static HANDLE con;
#endif
static int use_color = -1;
-#undef fprintf
static void colored_fputs(int level, const char *str)
{
if (use_color < 0) {
-#if defined(_WIN32) && !defined(__MINGW32CE__)
+#if HAVE_SETCONSOLETEXTATTRIBUTE
CONSOLE_SCREEN_BUFFER_INFO con_info;
con = GetStdHandle(STD_ERROR_HANDLE);
use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
if (level > av_log_level)
return;
line[0] = 0;
-#undef fprintf
if (print_prefix && avc) {
if (avc->parent_log_context_offset) {
AVClass** parent = *(AVClass ***) (((uint8_t *) ptr) +
{
av_log_callback = callback;
}
+
+static void missing_feature_sample(int sample, void *avc, const char *msg,
+ va_list argument_list)
+{
+ 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");
+}
+
+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);
+}