Move compat/ and bstr/ directory contents somewhere else

bstr.c doesn't really deserve its own directory, and compat had just
a few files, most of which may as well be in osdep. There isn't really
any justification for these extra directories, so get rid of them.

The compat/libav.h was empty - just delete it. We changed our approach
to API compatibility, and will likely not need it anymore.
This commit is contained in:
wm4 2014-08-29 12:09:04 +02:00
parent 4bc9c52a12
commit 68ff8a0484
77 changed files with 94 additions and 134 deletions

View File

@ -20,7 +20,7 @@
#include <inttypes.h>
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#define MP_NUM_CHANNELS 8

View File

@ -37,8 +37,6 @@
#include "ad.h"
#include "audio/fmt-conversion.h"
#include "compat/libav.h"
struct priv {
AVCodecContext *avctx;
AVFrame *avframe;

View File

@ -28,7 +28,7 @@
#include "config.h"
#include "common/codecs.h"
#include "common/msg.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "stream/stream.h"
#include "demux/demux.h"

View File

@ -20,7 +20,7 @@
#include "af.h"
#include "audio/format.h"
#include "compat/mpbswap.h"
#include "osdep/mpbswap.h"
static bool test_conversion(int src_format, int dst_format)
{

View File

@ -26,7 +26,7 @@
#include <stdbool.h>
#include "osdep/endian.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#if BYTE_ORDER == BIG_ENDIAN
#define AF_SELECT_LE_BE(LE, BE) BE

View File

@ -21,7 +21,7 @@
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "audio/chmap.h"
#include "audio/chmap_sel.h"

View File

@ -28,7 +28,6 @@
#include <libavutil/common.h>
#include <libavutil/audioconvert.h>
#include "compat/libav.h"
#include "config.h"
#include "options/options.h"
#include "common/common.h"

View File

@ -28,7 +28,7 @@
#include <mmdeviceapi.h>
#include <avrt.h>
#include "compat/atomics.h"
#include "osdep/atomics.h"
typedef struct wasapi_state {
struct mp_log *log;

View File

@ -30,7 +30,7 @@
#include "osdep/timer.h"
#include "osdep/threads.h"
#include "compat/atomics.h"
#include "osdep/atomics.h"
#include "misc/ring.h"
/*

View File

@ -35,7 +35,7 @@
#include "osdep/threads.h"
#include "osdep/timer.h"
#include "compat/atomics.h"
#include "osdep/atomics.h"
#include "audio/audio.h"
#include "audio/audio_buffer.h"

View File

@ -17,7 +17,7 @@
#include <assert.h>
#include "talloc.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/msg.h"
#include "codecs.h"

View File

@ -22,7 +22,7 @@
#include <libavutil/common.h>
#include "talloc.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#define appendf(ptr, ...) \

View File

@ -24,7 +24,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "compat/compiler.h"
#include "osdep/compiler.h"
#include "talloc.h"
// double should be able to represent this exactly

View File

@ -27,8 +27,8 @@
#include "talloc.h"
#include "bstr/bstr.h"
#include "compat/atomics.h"
#include "misc/bstr.h"
#include "osdep/atomics.h"
#include "common/common.h"
#include "common/global.h"
#include "misc/ring.h"

View File

@ -24,7 +24,7 @@
#include <stdlib.h>
#include <stdint.h>
#include "compat/compiler.h"
#include "osdep/compiler.h"
struct mp_log;

View File

@ -19,7 +19,7 @@
#define MPLAYER_PLAYLIST_H
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
struct playlist_param {
bstr name, value;

View File

@ -17,7 +17,7 @@
#include <libavutil/dict.h>
#include "tags.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
void mp_tags_set_str(struct mp_tags *tags, const char *key, const char *value)
{

View File

@ -1,7 +1,7 @@
#ifndef MP_TAGS_H
#define MP_TAGS_H
#include "bstr/bstr.h"
#include "misc/bstr.h"
struct mp_tags {
char **keys;

View File

@ -1,27 +0,0 @@
#ifndef MPV_COMPILER_H
#define MPV_COMPILER_H
#define MP_EXPAND_ARGS(...) __VA_ARGS__
#ifdef __GNUC__
#define MP_NORETURN __attribute__((noreturn))
/** Use gcc attribute to check printf fns. a1 is the 1-based index of
* the parameter containing the format, and a2 the index of the first
* argument. **/
#ifdef __MINGW32__
// MinGW maps "printf" to the non-standard MSVCRT functions, even if
// __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf",
// which isn't necessarily available on other GCC compatible compilers.
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2)))
#else
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (printf, a1, a2)))
#endif
#else
#define PRINTF_ATTRIBUTE(a1, a2)
#define MP_NORETURN
#endif
#endif

View File

@ -1,24 +0,0 @@
/*
* This file is part of mpv.
*
* mpv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPV_LIBAV_COMPAT_H
#define MPV_LIBAV_COMPAT_H
// There's nothing here. But for how long?
#endif /* MPV_LIBAV_COMPAT_H */

View File

@ -25,7 +25,7 @@
#include <string.h>
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "common/tags.h"
#include "packet.h"

View File

@ -22,7 +22,7 @@
#include <stdbool.h>
#include <string.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "demux.h"
#include "stream/stream.h"

View File

@ -39,13 +39,12 @@
# include <libavutil/display.h>
#endif
#include <libavutil/opt.h>
#include "compat/libav.h"
#include "options/options.h"
#include "common/msg.h"
#include "common/tags.h"
#include "common/av_common.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "stream/stream.h"
#include "demux.h"

View File

@ -44,7 +44,7 @@
#include "talloc.h"
#include "common/av_common.h"
#include "options/options.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "stream/stream.h"
#include "demux.h"
#include "stheader.h"

View File

@ -34,7 +34,7 @@
#include "talloc.h"
#include "ebml.h"
#include "stream/stream.h"
#include "compat/mpbswap.h"
#include "osdep/mpbswap.h"
#include "common/msg.h"
// Whether the id is a known Matroska level 1 element (allowed as element on

View File

@ -24,7 +24,7 @@
#include <stdbool.h>
#include "stream/stream.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
struct mp_log;

View File

@ -19,7 +19,7 @@
#ifndef MPLAYER_MS_HDR_H
#define MPLAYER_MS_HDR_H
#include "compat/mpbswap.h"
#include "osdep/mpbswap.h"
#include "video/img_fourcc.h"
// These structs must be binary-compatible to the native win32 types,

View File

@ -18,7 +18,7 @@
#include <stddef.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "common/msg.h"
#include "options/m_option.h"

View File

@ -15,7 +15,7 @@
* with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bstr/bstr.h"
#include "misc/bstr.h"
struct input_ctx;

View File

@ -48,7 +48,7 @@
#include "options/path.h"
#include "talloc.h"
#include "options/options.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "stream/stream.h"
#include "common/common.h"

View File

@ -20,7 +20,7 @@
#define MPLAYER_INPUT_H
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "cmd_list.h"
#include "cmd_parse.h"

View File

@ -20,7 +20,7 @@
#include <string.h>
#include <strings.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "common/msg.h"

View File

@ -10,7 +10,7 @@
#endif
#include "common/msg.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "osdep/io.h"
#include "input.h"
#include "cmd_parse.h"

View File

@ -2,7 +2,7 @@
#define MP_CHARSET_CONV_H
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
struct mp_log;

View File

@ -21,7 +21,7 @@
#include <libavutil/common.h>
#include <assert.h>
#include "talloc.h"
#include "compat/atomics.h"
#include "osdep/atomics.h"
#include "ring.h"
struct mp_ring {

View File

@ -146,7 +146,6 @@ SOURCES = audio/audio.c \
audio/out/ao_pcm.c \
audio/out/pull.c \
audio/out/push.c \
bstr/bstr.c \
common/av_common.c \
common/av_log.c \
common/codecs.c \
@ -175,6 +174,7 @@ SOURCES = audio/audio.c \
input/input.c \
input/keycodes.c \
input/pipe.c \
misc/bstr.c \
misc/charset_conv.c \
misc/dispatch.c \
misc/rendezvous.c \
@ -303,7 +303,6 @@ DIRS = . \
audio/decode \
audio/filter \
audio/out \
bstr \
common \
compat \
input \

View File

@ -22,7 +22,7 @@
#include <stddef.h>
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
// m_config provides an API to manipulate the config variables in MPlayer.
// It makes use of the Options API to provide a context stack that

View File

@ -23,7 +23,7 @@
#include <stddef.h>
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "audio/chmap.h"
// m_option allows to parse, print and copy data of various types.

View File

@ -22,7 +22,7 @@
#define MPLAYER_PATH_H
#include <stdbool.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
struct mpv_global;

View File

@ -1 +1,27 @@
#include "compat/compiler.h"
#ifndef MPV_COMPILER_H
#define MPV_COMPILER_H
#define MP_EXPAND_ARGS(...) __VA_ARGS__
#ifdef __GNUC__
#define MP_NORETURN __attribute__((noreturn))
/** Use gcc attribute to check printf fns. a1 is the 1-based index of
* the parameter containing the format, and a2 the index of the first
* argument. **/
#ifdef __MINGW32__
// MinGW maps "printf" to the non-standard MSVCRT functions, even if
// __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf",
// which isn't necessarily available on other GCC compatible compilers.
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2)))
#else
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (printf, a1, a2)))
#endif
#else
#define PRINTF_ATTRIBUTE(a1, a2)
#define MP_NORETURN
#endif
#endif

View File

@ -43,7 +43,7 @@
#include <unistd.h>
#include "common/common.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "input/input.h"
#include "input/keycodes.h"
#include "misc/ctype.h"

View File

@ -39,7 +39,7 @@
#include "options/m_option.h"
#include "input/input.h"
#include "options/path.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "osdep/timer.h"
#include "osdep/threads.h"
#include "sub/osd.h"

View File

@ -28,7 +28,7 @@
#include "screenshot.h"
#include "core.h"
#include "command.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/msg.h"
#include "options/path.h"
#include "video/mp_image.h"

View File

@ -30,7 +30,7 @@
#include "common/common.h"
#include "common/msg.h"
#include "options/path.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "core.h"
#include "client.h"
#include "libmpv/client.h"

View File

@ -27,7 +27,7 @@
#include "common/msg.h"
#include "demux/demux.h"
#include "options/path.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "stream/stream.h"

View File

@ -34,7 +34,7 @@
#include "common/msg.h"
#include "demux/demux.h"
#include "options/path.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "common/playlist.h"
#include "stream/stream.h"

View File

@ -27,7 +27,7 @@
#include "common/msg.h"
#include "demux/demux.h"
#include "options/path.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "stream/stream.h"

View File

@ -31,7 +31,7 @@
#include <assert.h>
#include <libavutil/common.h>
#include "compat/mpbswap.h"
#include "osdep/mpbswap.h"
#include "talloc.h"
@ -39,7 +39,7 @@
#include "common/common.h"
#include "common/global.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/msg.h"
#include "options/options.h"
#include "options/path.h"

View File

@ -27,7 +27,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
enum streamtype {
STREAMTYPE_GENERIC = 0,

View File

@ -46,7 +46,7 @@
#include "options/m_option.h"
#include "options/m_config.h"
#include "options/options.h"
#include "compat/mpbswap.h"
#include "osdep/mpbswap.h"
#include "common/msg.h"

View File

@ -31,7 +31,7 @@
#include "cookies.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "talloc.h"
struct stream_lavf_params *stream_lavf_opts;

View File

@ -25,7 +25,7 @@
#include "config.h"
#include "talloc.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/common.h"
#include "common/msg.h"
#include "osd.h"

View File

@ -27,7 +27,7 @@
#include "talloc.h"
#include "common/msg.h"
#include "common/av_common.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "sd.h"
#define HAVE_AV_WEBVTT (LIBAVCODEC_VERSION_MICRO >= 100)

View File

@ -21,7 +21,7 @@
#include <inttypes.h>
#include <assert.h>
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "sd.h"
/*

View File

@ -27,7 +27,7 @@
#include <libavutil/common.h>
#include "common/msg.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "sd.h"
struct line {

View File

@ -28,7 +28,7 @@
#include "common/common.h"
#include "common/msg.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "misc/ctype.h"
#include "sd.h"

View File

@ -2,6 +2,6 @@
#include <stdio.h>
#include <stdarg.h>
#include "compat/compiler.h"
#include "osdep/compiler.h"
#include "ta/ta_talloc.h"

View File

@ -28,17 +28,15 @@
#include <libavutil/intreadwrite.h>
#include <libavutil/pixdesc.h>
#include "compat/libav.h"
#include "talloc.h"
#include "config.h"
#include "common/msg.h"
#include "options/options.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/av_common.h"
#include "common/codecs.h"
#include "compat/mpbswap.h"
#include "osdep/mpbswap.h"
#include "video/fmt-conversion.h"
#include "vd.h"

View File

@ -26,7 +26,7 @@
#include "config.h"
#include "common/msg.h"
#include "options/m_option.h"
#include "compat/mpbswap.h"
#include "osdep/mpbswap.h"
#include "video/img_format.h"
#include "video/mp_image.h"

View File

@ -32,7 +32,6 @@
#include "video/mp_image.h"
#include "vf.h"
#include "video/fmt-conversion.h"
#include "compat/mpbswap.h"
#include "video/sws_utils.h"

View File

@ -23,8 +23,6 @@
#include <libavcodec/avcodec.h>
#include <libavutil/mem.h>
#include "compat/libav.h"
#include "config.h"
#if HAVE_JPEG

View File

@ -22,8 +22,6 @@
#include <libavutil/pixfmt.h>
#include <libavutil/pixdesc.h>
#include "compat/libav.h"
#include "video/img_format.h"
#include "video/mp_image.h"
#include "video/fmt-conversion.h"

View File

@ -22,7 +22,7 @@
#include <inttypes.h>
#include "osdep/endian.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#if BYTE_ORDER == BIG_ENDIAN
#define MP_SELECT_LE_BE(LE, BE) BE

View File

@ -30,7 +30,7 @@
#include "config.h"
#include "common/msg.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "vo.h"
#include "video/csputils.h"

View File

@ -28,7 +28,7 @@
#include "stream/stream.h"
#include "common/common.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/msg.h"
#include "options/m_option.h"
#include "options/path.h"

View File

@ -30,7 +30,7 @@
#include "gl_video.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "gl_common.h"
#include "gl_osd.h"
#include "filter_kernels.h"

View File

@ -36,7 +36,7 @@
#include "misc/dispatch.h"
#include "misc/rendezvous.h"
#include "options/options.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "vo.h"
#include "aspect.h"
#include "input/input.h"

View File

@ -25,7 +25,7 @@
#include <libswscale/swscale.h>
#include "config.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "osdep/io.h"
#include "options/path.h"
#include "talloc.h"

View File

@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdlib.h>
#include "compat/libav.h"
#include "common/common.h"
#include "options/options.h"
#include "video/fmt-conversion.h"

View File

@ -36,7 +36,7 @@
#include "talloc.h"
#include "common/common.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "common/msg.h"
#include "options/m_config.h"
#include "vo.h"

View File

@ -31,7 +31,7 @@
#include <linux/input.h>
#include "config.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "options/options.h"
#include "common/msg.h"
#include "talloc.h"

View File

@ -23,7 +23,7 @@
#include <limits.h>
#include "config.h"
#include "bstr/bstr.h"
#include "misc/bstr.h"
#include "options/options.h"
#include "common/common.h"
#include "common/msg.h"

View File

@ -155,9 +155,6 @@ def build(ctx):
( "audio/out/pull.c" ),
( "audio/out/push.c" ),
## Bstr
( "bstr/bstr.c" ),
## Core
( "common/av_common.c" ),
( "common/av_log.c" ),
@ -198,6 +195,7 @@ def build(ctx):
( "input/lirc.c", "lirc" ),
## Misc
( "misc/bstr.c" ),
( "misc/charset_conv.c" ),
( "misc/dispatch.c" ),
( "misc/ring.c" ),