[FFmpeg-cvslog] Merge commit 'e41daa62465036ad36ad0bd14e4936e848d7f07e'
James Almer
git at videolan.org
Sat Nov 11 15:29:41 EET 2017
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Nov 11 10:22:11 2017 -0300| [f87ad3a058bfee786e942106c5c3450c02a66d48] | committer: James Almer
Merge commit 'e41daa62465036ad36ad0bd14e4936e848d7f07e'
* commit 'e41daa62465036ad36ad0bd14e4936e848d7f07e':
Remove support for building for mingw32ce (Windows CE)
Merged-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f87ad3a058bfee786e942106c5c3450c02a66d48
---
configure | 8 +-------
libavformat/os_support.h | 8 +++-----
libavutil/file_open.c | 2 +-
libavutil/log.c | 6 +++---
libavutil/wchar_filename.h | 2 +-
tools/qt-faststart.c | 5 +----
6 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/configure b/configure
index 2cf18ecc12..50443c0401 100755
--- a/configure
+++ b/configure
@@ -5033,16 +5033,10 @@ case $target_os in
die "Native MSYS builds are discouraged, please use the MINGW environment."
;;
mingw32*|mingw64*)
- if test $target_os = "mingw32ce"; then
- disable network
- else
- target_os=mingw32
- fi
+ target_os=mingw32
LIBTARGET=i386
if enabled x86_64; then
LIBTARGET="i386:x86-64"
- elif enabled arm; then
- LIBTARGET=arm-wince
fi
enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
enabled x86_32 && check_ldflags -Wl,--large-address-aware
diff --git a/libavformat/os_support.h b/libavformat/os_support.h
index ca995f9de6..7a56dc9a7c 100644
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@ -40,7 +40,7 @@
#endif
#endif
-#if defined(_WIN32) && !defined(__MINGW32CE__)
+#ifdef _WIN32
# include <fcntl.h>
# ifdef lseek
# undef lseek
@@ -54,7 +54,7 @@
# undef fstat
# endif
# define fstat(f,s) _fstati64((f), (s))
-#endif /* defined(_WIN32) && !defined(__MINGW32CE__) */
+#endif /* defined(_WIN32) */
#ifdef __ANDROID__
@@ -139,9 +139,7 @@ int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout);
#endif /* HAVE_POLL_H */
#endif /* CONFIG_NETWORK */
-#if defined(__MINGW32CE__)
-#define mkdir(a, b) _mkdir(a)
-#elif defined(_WIN32)
+#ifdef _WIN32
#include <stdio.h>
#include <windows.h>
#include "libavutil/wchar_filename.h"
diff --git a/libavutil/file_open.c b/libavutil/file_open.c
index 258bb3074e..a8da283583 100644
--- a/libavutil/file_open.c
+++ b/libavutil/file_open.c
@@ -29,7 +29,7 @@
#include <io.h>
#endif
-#if defined(_WIN32) && !defined(__MINGW32CE__)
+#ifdef _WIN32
#undef open
#undef lseek
#undef stat
diff --git a/libavutil/log.c b/libavutil/log.c
index be806202ff..7a6dd936e5 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -57,7 +57,7 @@ static int av_log_level = AV_LOG_INFO;
static int flags;
#define NB_LEVELS 8
-#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
+#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE
#include <windows.h>
static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
[AV_LOG_PANIC /8] = 12,
@@ -124,7 +124,7 @@ static int use_color = -1;
static void check_color_terminal(void)
{
-#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
+#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE
CONSOLE_SCREEN_BUFFER_INFO con_info;
con = GetStdHandle(STD_ERROR_HANDLE);
use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
@@ -159,7 +159,7 @@ static void colored_fputs(int level, int tint, const char *str)
if (level == AV_LOG_INFO/8) local_use_color = 0;
else local_use_color = use_color;
-#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
+#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE
if (local_use_color)
SetConsoleTextAttribute(con, background | color[level]);
fputs(str, stderr);
diff --git a/libavutil/wchar_filename.h b/libavutil/wchar_filename.h
index 2ade321bed..142d50e7c3 100644
--- a/libavutil/wchar_filename.h
+++ b/libavutil/wchar_filename.h
@@ -19,7 +19,7 @@
#ifndef AVUTIL_WCHAR_FILENAME_H
#define AVUTIL_WCHAR_FILENAME_H
-#if defined(_WIN32) && !defined(__MINGW32CE__)
+#ifdef _WIN32
#include <windows.h>
#include "mem.h"
diff --git a/tools/qt-faststart.c b/tools/qt-faststart.c
index 728f80c39c..97be019c58 100644
--- a/tools/qt-faststart.c
+++ b/tools/qt-faststart.c
@@ -29,10 +29,7 @@
#include <inttypes.h>
#include <string.h>
-#ifdef __MINGW32CE__
-#define fseeko(x, y, z) fseek(x, y, z)
-#define ftello(x) ftell(x)
-#elif defined(__MINGW32__)
+#ifdef __MINGW32__
#undef fseeko
#define fseeko(x, y, z) fseeko64(x, y, z)
#undef ftello
======================================================================
diff --cc configure
index 2cf18ecc12,b995235708..50443c0401
--- a/configure
+++ b/configure
@@@ -5041,11 -4025,9 +5037,9 @@@ case $target_os i
LIBTARGET=i386
if enabled x86_64; then
LIBTARGET="i386:x86-64"
- elif enabled arm; then
- LIBTARGET=arm-wince
fi
- check_ldflags -Wl,--nxcompat
- check_ldflags -Wl,--dynamicbase
+ enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
+ enabled x86_32 && check_ldflags -Wl,--large-address-aware
shlibdir_default="$bindir_default"
SLIBPREF=""
SLIBSUF=".dll"
diff --cc libavformat/os_support.h
index ca995f9de6,75a12960f3..7a56dc9a7c
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@@ -40,33 -40,16 +40,33 @@@
#endif
#endif
- #if defined(_WIN32) && !defined(__MINGW32CE__)
+ #ifdef _WIN32
# include <fcntl.h>
-# undef lseek
+# ifdef lseek
+# undef lseek
+# endif
# define lseek(f,p,w) _lseeki64((f), (p), (w))
-# undef stat
+# ifdef stat
+# undef stat
+# endif
# define stat _stati64
-# undef fstat
+# ifdef fstat
+# undef fstat
+# endif
# define fstat(f,s) _fstati64((f), (s))
- #endif /* defined(_WIN32) && !defined(__MINGW32CE__) */
+ #endif /* defined(_WIN32) */
+
+#ifdef __ANDROID__
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+# ifdef lseek
+# undef lseek
+# endif
+# define lseek(f,p,w) lseek64((f), (p), (w))
+#endif
+
static inline int is_dos_path(const char *path)
{
#if HAVE_DOS_PATHS
diff --cc libavutil/log.c
index be806202ff,37427efaf1..7a6dd936e5
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@@ -57,74 -50,27 +57,74 @@@ static int av_log_level = AV_LOG_INFO
static int flags;
#define NB_LEVELS 8
- #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
-#if HAVE_SETCONSOLETEXTATTRIBUTE
++#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE
#include <windows.h>
-static const uint8_t color[NB_LEVELS] = { 12, 12, 12, 14, 7, 10, 11, 8};
+static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
+ [AV_LOG_PANIC /8] = 12,
+ [AV_LOG_FATAL /8] = 12,
+ [AV_LOG_ERROR /8] = 12,
+ [AV_LOG_WARNING/8] = 14,
+ [AV_LOG_INFO /8] = 7,
+ [AV_LOG_VERBOSE/8] = 10,
+ [AV_LOG_DEBUG /8] = 10,
+ [AV_LOG_TRACE /8] = 8,
+ [16+AV_CLASS_CATEGORY_NA ] = 7,
+ [16+AV_CLASS_CATEGORY_INPUT ] = 13,
+ [16+AV_CLASS_CATEGORY_OUTPUT ] = 5,
+ [16+AV_CLASS_CATEGORY_MUXER ] = 13,
+ [16+AV_CLASS_CATEGORY_DEMUXER ] = 5,
+ [16+AV_CLASS_CATEGORY_ENCODER ] = 11,
+ [16+AV_CLASS_CATEGORY_DECODER ] = 3,
+ [16+AV_CLASS_CATEGORY_FILTER ] = 10,
+ [16+AV_CLASS_CATEGORY_BITSTREAM_FILTER] = 9,
+ [16+AV_CLASS_CATEGORY_SWSCALER ] = 7,
+ [16+AV_CLASS_CATEGORY_SWRESAMPLER ] = 7,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ] = 13,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ] = 5,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ] = 13,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ] = 5,
+ [16+AV_CLASS_CATEGORY_DEVICE_OUTPUT ] = 13,
+ [16+AV_CLASS_CATEGORY_DEVICE_INPUT ] = 5,
+};
+
static int16_t background, attr_orig;
static HANDLE con;
-#define set_color(x) SetConsoleTextAttribute(con, background | color[x])
-#define reset_color() SetConsoleTextAttribute(con, attr_orig)
-#define print_256color(x)
#else
-static const uint8_t color[NB_LEVELS] = {
- 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x06, 0x07
+
+static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = {
+ [AV_LOG_PANIC /8] = 52 << 16 | 196 << 8 | 0x41,
+ [AV_LOG_FATAL /8] = 208 << 8 | 0x41,
+ [AV_LOG_ERROR /8] = 196 << 8 | 0x11,
+ [AV_LOG_WARNING/8] = 226 << 8 | 0x03,
+ [AV_LOG_INFO /8] = 253 << 8 | 0x09,
+ [AV_LOG_VERBOSE/8] = 40 << 8 | 0x02,
+ [AV_LOG_DEBUG /8] = 34 << 8 | 0x02,
+ [AV_LOG_TRACE /8] = 34 << 8 | 0x07,
+ [16+AV_CLASS_CATEGORY_NA ] = 250 << 8 | 0x09,
+ [16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_OUTPUT ] = 201 << 8 | 0x05,
+ [16+AV_CLASS_CATEGORY_MUXER ] = 213 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_DEMUXER ] = 207 << 8 | 0x05,
+ [16+AV_CLASS_CATEGORY_ENCODER ] = 51 << 8 | 0x16,
+ [16+AV_CLASS_CATEGORY_DECODER ] = 39 << 8 | 0x06,
+ [16+AV_CLASS_CATEGORY_FILTER ] = 155 << 8 | 0x12,
+ [16+AV_CLASS_CATEGORY_BITSTREAM_FILTER] = 192 << 8 | 0x14,
+ [16+AV_CLASS_CATEGORY_SWSCALER ] = 153 << 8 | 0x14,
+ [16+AV_CLASS_CATEGORY_SWRESAMPLER ] = 147 << 8 | 0x14,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ] = 213 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ] = 207 << 8 | 0x05,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ] = 213 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ] = 207 << 8 | 0x05,
+ [16+AV_CLASS_CATEGORY_DEVICE_OUTPUT ] = 213 << 8 | 0x15,
+ [16+AV_CLASS_CATEGORY_DEVICE_INPUT ] = 207 << 8 | 0x05,
};
-#define set_color(x) fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15)
-#define print_256color(x) fprintf(stderr, "\033[38;5;%dm", x)
-#define reset_color() fprintf(stderr, "\033[0m")
+
#endif
static int use_color = -1;
static void check_color_terminal(void)
{
- #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
-#if HAVE_SETCONSOLETEXTATTRIBUTE
++#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE
CONSOLE_SCREEN_BUFFER_INFO con_info;
con = GetStdHandle(STD_ERROR_HANDLE);
use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
@@@ -156,38 -97,22 +156,38 @@@ static void colored_fputs(int level, in
if (use_color < 0)
check_color_terminal();
- switch (use_color) {
- case 1:
- set_color(level);
- break;
- case 2:
- set_color(level);
- if (tint)
- print_256color(tint);
- break;
- default:
- break;
- }
+ if (level == AV_LOG_INFO/8) local_use_color = 0;
+ else local_use_color = use_color;
+
- #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
++#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE
+ if (local_use_color)
+ SetConsoleTextAttribute(con, background | color[level]);
fputs(str, stderr);
- if (use_color) {
- reset_color();
- }
+ if (local_use_color)
+ SetConsoleTextAttribute(con, attr_orig);
+#else
+ if (local_use_color == 1) {
+ fprintf(stderr,
+ "\033[%"PRIu32";3%"PRIu32"m%s\033[0m",
+ (color[level] >> 4) & 15,
+ color[level] & 15,
+ str);
+ } else if (tint && use_color == 256) {
+ fprintf(stderr,
+ "\033[48;5;%"PRIu32"m\033[38;5;%dm%s\033[0m",
+ (color[level] >> 16) & 0xff,
+ tint,
+ str);
+ } else if (local_use_color == 256) {
+ fprintf(stderr,
+ "\033[48;5;%"PRIu32"m\033[38;5;%"PRIu32"m%s\033[0m",
+ (color[level] >> 16) & 0xff,
+ (color[level] >> 8) & 0xff,
+ str);
+ } else
+ fputs(str, stderr);
+#endif
+
}
const char *av_default_item_name(void *ptr)
More information about the ffmpeg-cvslog
mailing list