From a84258d769a3d06958a017bb3fc47521ade5751b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Oct 2013 21:35:29 +0100 Subject: [PATCH] Move files part of the playback core to player sub-directory All these files access mp_core.h and MPContext, and form the actual player application. They should be all in one place, and separate from the other sources that are mere utility helpers. Preparation for splitting mplayer.c into multiple smaller parts. --- .gitignore | 2 +- Makefile | 32 ++++++++++----------- mpvcore/options.c | 2 +- mpvcore/{ => player}/command.c | 18 ++++++------ mpvcore/{ => player}/command.h | 0 mpvcore/{ => player}/lua/assdraw.lua | 0 mpvcore/{ => player}/lua/defaults.lua | 0 mpvcore/{ => player}/lua/osc.lua | 0 mpvcore/{ => player}/mp_core.h | 0 mpvcore/{ => player}/mp_lua.c | 20 ++++++------- mpvcore/{ => player}/mp_lua.h | 0 mpvcore/{ => player}/mp_osd.h | 0 mpvcore/{ => player}/mplayer.c | 10 +++---- mpvcore/{ => player}/screenshot.c | 8 +++--- mpvcore/{ => player}/screenshot.h | 0 mpvcore/{ => player}/timeline/tl_cue.c | 2 +- mpvcore/{ => player}/timeline/tl_edl.c | 2 +- mpvcore/{ => player}/timeline/tl_matroska.c | 2 +- 18 files changed, 48 insertions(+), 50 deletions(-) rename mpvcore/{ => player}/command.c (99%) rename mpvcore/{ => player}/command.h (100%) rename mpvcore/{ => player}/lua/assdraw.lua (100%) rename mpvcore/{ => player}/lua/defaults.lua (100%) rename mpvcore/{ => player}/lua/osc.lua (100%) rename mpvcore/{ => player}/mp_core.h (100%) rename mpvcore/{ => player}/mp_lua.c (98%) rename mpvcore/{ => player}/mp_lua.h (100%) rename mpvcore/{ => player}/mp_osd.h (100%) rename mpvcore/{ => player}/mplayer.c (99%) rename mpvcore/{ => player}/screenshot.c (98%) rename mpvcore/{ => player}/screenshot.h (100%) rename mpvcore/{ => player}/timeline/tl_cue.c (99%) rename mpvcore/{ => player}/timeline/tl_edl.c (99%) rename mpvcore/{ => player}/timeline/tl_matroska.c (99%) diff --git a/.gitignore b/.gitignore index 07eab0dfbd146..f4361056dacff 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ /demux/ebml_defs.c /demux/ebml_types.h /sub/osd_font.h -/mpvcore/lua/*.inc +/mpvcore/player/lua/*.inc /DOCS/man/*/mpv.1 /DOCS/man/*/mpv.aux /DOCS/man/*/mpv.log diff --git a/Makefile b/Makefile index 6d86320ffa15b..7c9807f175a96 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,7 @@ SOURCES-$(WAYLAND) += video/out/vo_wayland.c video/out/wayland_comm SOURCES-$(VF_LAVFI) += video/filter/vf_lavfi.c SOURCES-$(AF_LAVFI) += audio/filter/af_lavfi.c -SOURCES-$(LUA) += mpvcore/mp_lua.c +SOURCES-$(LUA) += mpvcore/player/mp_lua.c ifeq ($(HAVE_AVUTIL_REFCOUNTING),no) SOURCES-yes += video/decode/lavc_dr1.c @@ -194,7 +194,6 @@ SOURCES = audio/audio.c \ mpvcore/bstr.c \ mpvcore/charset_conv.c \ mpvcore/codecs.c \ - mpvcore/command.c \ mpvcore/cpudetect.c \ mpvcore/m_config.c \ mpvcore/m_option.c \ @@ -202,19 +201,20 @@ SOURCES = audio/audio.c \ mpvcore/mp_common.c \ mpvcore/mp_msg.c \ mpvcore/mp_ring.c \ - mpvcore/mplayer.c \ mpvcore/options.c \ mpvcore/parser-cfg.c \ mpvcore/parser-mpcmd.c \ mpvcore/path.c \ mpvcore/playlist.c \ mpvcore/playlist_parser.c \ - mpvcore/screenshot.c \ mpvcore/version.c \ mpvcore/input/input.c \ - mpvcore/timeline/tl_edl.c \ - mpvcore/timeline/tl_matroska.c \ - mpvcore/timeline/tl_cue.c \ + mpvcore/player/command.c \ + mpvcore/player/mplayer.c \ + mpvcore/player/screenshot.c \ + mpvcore/player/timeline/tl_edl.c \ + mpvcore/player/timeline/tl_matroska.c \ + mpvcore/player/timeline/tl_cue.c \ osdep/io.c \ osdep/numcores.c \ osdep/timer.c \ @@ -408,16 +408,16 @@ sub/osd_libass.c: sub/osd_font.h sub/osd_font.h: TOOLS/file2string.pl sub/osd_font.otf ./$^ >$@ -mpvcore/mp_lua.c: mpvcore/lua/defaults.inc -mpvcore/lua/defaults.inc: TOOLS/file2string.pl mpvcore/lua/defaults.lua +mpvcore/player/mp_lua.c: mpvcore/player/lua/defaults.inc +mpvcore/player/lua/defaults.inc: TOOLS/file2string.pl mpvcore/player/lua/defaults.lua ./$^ >$@ -mpvcore/mp_lua.c: mpvcore/lua/assdraw.inc -mpvcore/lua/assdraw.inc: TOOLS/file2string.pl mpvcore/lua/assdraw.lua +mpvcore/player/mp_lua.c: mpvcore/player/lua/assdraw.inc +mpvcore/player/lua/assdraw.inc: TOOLS/file2string.pl mpvcore/player/lua/assdraw.lua ./$^ >$@ -mpvcore/mp_lua.c: mpvcore/lua/osc.inc -mpvcore/lua/osc.inc: TOOLS/file2string.pl mpvcore/lua/osc.lua +mpvcore/player/mp_lua.c: mpvcore/player/lua/osc.inc +mpvcore/player/lua/osc.inc: TOOLS/file2string.pl mpvcore/player/lua/osc.lua ./$^ >$@ # ./configure must be rerun if it changed @@ -518,9 +518,9 @@ clean: -$(RM) video/out/gl_video_shaders.h -$(RM) video/out/x11_icon.inc -$(RM) sub/osd_font.h - -$(RM) mpvcore/lua/defaults.inc - -$(RM) mpvcore/lua/assdraw.inc - -$(RM) mpvcore/lua/osc.inc + -$(RM) mpvcore/player/lua/defaults.inc + -$(RM) mpvcore/player/lua/assdraw.inc + -$(RM) mpvcore/player/lua/osc.inc distclean: clean -$(RM) config.log config.mak config.h TAGS tags diff --git a/mpvcore/options.c b/mpvcore/options.c index 619310235e3b1..32d108d119c4b 100644 --- a/mpvcore/options.c +++ b/mpvcore/options.c @@ -39,7 +39,7 @@ #include "audio/mixer.h" #include "audio/filter/af.h" #include "audio/decode/dec_audio.h" -#include "mp_core.h" +#include "player/mp_core.h" #include "osdep/priority.h" int network_bandwidth=0; diff --git a/mpvcore/command.c b/mpvcore/player/command.c similarity index 99% rename from mpvcore/command.c rename to mpvcore/player/command.c index f20a6517b8fe3..f1a2453ca96bd 100644 --- a/mpvcore/command.c +++ b/mpvcore/player/command.c @@ -30,27 +30,26 @@ #include "config.h" #include "talloc.h" #include "command.h" -#include "input/input.h" +#include "mpvcore/mp_common.h" +#include "mpvcore/input/input.h" #include "stream/stream.h" #include "demux/demux.h" #include "demux/stheader.h" -#include "resolve.h" -#include "playlist.h" -#include "playlist_parser.h" +#include "mpvcore/resolve.h" +#include "mpvcore/playlist.h" +#include "mpvcore/playlist_parser.h" #include "sub/sub.h" #include "sub/dec_sub.h" #include "mpvcore/m_option.h" -#include "m_property.h" -#include "m_config.h" +#include "mpvcore/m_property.h" +#include "mpvcore/m_config.h" #include "video/filter/vf.h" #include "video/decode/vd.h" #include "mp_osd.h" #include "video/out/vo.h" #include "video/csputils.h" -#include "playlist.h" #include "audio/mixer.h" #include "audio/out/ao.h" -#include "mpvcore/mp_common.h" #include "audio/filter/af.h" #include "video/decode/dec_video.h" #include "audio/decode/dec_audio.h" @@ -66,8 +65,7 @@ #include #endif -#include "mpvcore/mp_core.h" - +#include "mp_core.h" #include "mp_lua.h" struct command_ctx { diff --git a/mpvcore/command.h b/mpvcore/player/command.h similarity index 100% rename from mpvcore/command.h rename to mpvcore/player/command.h diff --git a/mpvcore/lua/assdraw.lua b/mpvcore/player/lua/assdraw.lua similarity index 100% rename from mpvcore/lua/assdraw.lua rename to mpvcore/player/lua/assdraw.lua diff --git a/mpvcore/lua/defaults.lua b/mpvcore/player/lua/defaults.lua similarity index 100% rename from mpvcore/lua/defaults.lua rename to mpvcore/player/lua/defaults.lua diff --git a/mpvcore/lua/osc.lua b/mpvcore/player/lua/osc.lua similarity index 100% rename from mpvcore/lua/osc.lua rename to mpvcore/player/lua/osc.lua diff --git a/mpvcore/mp_core.h b/mpvcore/player/mp_core.h similarity index 100% rename from mpvcore/mp_core.h rename to mpvcore/player/mp_core.h diff --git a/mpvcore/mp_lua.c b/mpvcore/player/mp_lua.c similarity index 98% rename from mpvcore/mp_lua.c rename to mpvcore/player/mp_lua.c index 4741cb1f33af4..9339329f17276 100644 --- a/mpvcore/mp_lua.c +++ b/mpvcore/player/mp_lua.c @@ -7,18 +7,18 @@ #include "talloc.h" -#include "mp_common.h" -#include "mp_lua.h" +#include "mpvcore/mp_common.h" +#include "mpvcore/m_property.h" +#include "mpvcore/mp_msg.h" +#include "mpvcore/m_option.h" +#include "mpvcore/input/input.h" +#include "mpvcore/path.h" +#include "mpvcore/bstr.h" +#include "osdep/timer.h" +#include "sub/sub.h" #include "mp_core.h" -#include "mp_msg.h" -#include "m_property.h" -#include "m_option.h" #include "command.h" -#include "input/input.h" -#include "sub/sub.h" -#include "osdep/timer.h" -#include "path.h" -#include "bstr.h" +#include "mp_lua.h" // List of builtin modules and their contents as strings. // All these are generated from mpvcore/lua/*.lua diff --git a/mpvcore/mp_lua.h b/mpvcore/player/mp_lua.h similarity index 100% rename from mpvcore/mp_lua.h rename to mpvcore/player/mp_lua.h diff --git a/mpvcore/mp_osd.h b/mpvcore/player/mp_osd.h similarity index 100% rename from mpvcore/mp_osd.h rename to mpvcore/player/mp_osd.h diff --git a/mpvcore/mplayer.c b/mpvcore/player/mplayer.c similarity index 99% rename from mpvcore/mplayer.c rename to mpvcore/player/mplayer.c index 480149a17e58d..b92b38e050c06 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/player/mplayer.c @@ -65,7 +65,7 @@ #include "mpvcore/mpv_global.h" #include "mpvcore/mp_msg.h" -#include "av_log.h" +#include "mpvcore/av_log.h" #include "mpvcore/m_option.h" @@ -77,9 +77,9 @@ #include "sub/dec_sub.h" #include "sub/sd.h" -#include "mpvcore/mp_osd.h" +#include "mp_osd.h" #include "video/out/vo.h" -#include "mpvcore/screenshot.h" +#include "screenshot.h" #include "sub/sub.h" #include "mpvcore/cpudetect.h" @@ -146,7 +146,7 @@ #include "audio/mixer.h" -#include "mpvcore/mp_core.h" +#include "mp_core.h" #include "mpvcore/options.h" #include "mp_lua.h" @@ -198,7 +198,7 @@ static const char av_desync_help_text[] = _( // --- #include "mpvcore/mp_common.h" -#include "mpvcore/command.h" +#include "command.h" static void reset_subtitles(struct MPContext *mpctx); static void reinit_subs(struct MPContext *mpctx); diff --git a/mpvcore/screenshot.c b/mpvcore/player/screenshot.c similarity index 98% rename from mpvcore/screenshot.c rename to mpvcore/player/screenshot.c index 181292474bfdf..bafb3012fb2e4 100644 --- a/mpvcore/screenshot.c +++ b/mpvcore/player/screenshot.c @@ -25,12 +25,12 @@ #include "osdep/io.h" #include "talloc.h" -#include "mpvcore/screenshot.h" -#include "mpvcore/mp_core.h" -#include "mpvcore/command.h" +#include "screenshot.h" +#include "mp_core.h" +#include "command.h" #include "mpvcore/bstr.h" #include "mpvcore/mp_msg.h" -#include "mpvcore/mp_osd.h" +#include "mp_osd.h" #include "mpvcore/path.h" #include "video/mp_image.h" #include "video/decode/dec_video.h" diff --git a/mpvcore/screenshot.h b/mpvcore/player/screenshot.h similarity index 100% rename from mpvcore/screenshot.h rename to mpvcore/player/screenshot.h diff --git a/mpvcore/timeline/tl_cue.c b/mpvcore/player/timeline/tl_cue.c similarity index 99% rename from mpvcore/timeline/tl_cue.c rename to mpvcore/player/timeline/tl_cue.c index 634a6de5f498a..e68b3349a56da 100644 --- a/mpvcore/timeline/tl_cue.c +++ b/mpvcore/player/timeline/tl_cue.c @@ -24,7 +24,7 @@ #include "talloc.h" -#include "mpvcore/mp_core.h" +#include "mpvcore/player/mp_core.h" #include "mpvcore/mp_msg.h" #include "demux/demux.h" #include "mpvcore/path.h" diff --git a/mpvcore/timeline/tl_edl.c b/mpvcore/player/timeline/tl_edl.c similarity index 99% rename from mpvcore/timeline/tl_edl.c rename to mpvcore/player/timeline/tl_edl.c index 6fdcd6685c6ff..69e240214938c 100644 --- a/mpvcore/timeline/tl_edl.c +++ b/mpvcore/player/timeline/tl_edl.c @@ -23,7 +23,7 @@ #include "talloc.h" -#include "mpvcore/mp_core.h" +#include "mpvcore/player/mp_core.h" #include "mpvcore/mp_msg.h" #include "demux/demux.h" #include "mpvcore/path.h" diff --git a/mpvcore/timeline/tl_matroska.c b/mpvcore/player/timeline/tl_matroska.c similarity index 99% rename from mpvcore/timeline/tl_matroska.c rename to mpvcore/player/timeline/tl_matroska.c index 55ef9cf825377..5a96cfe5f1196 100644 --- a/mpvcore/timeline/tl_matroska.c +++ b/mpvcore/player/timeline/tl_matroska.c @@ -30,7 +30,7 @@ #include "talloc.h" -#include "mpvcore/mp_core.h" +#include "mpvcore/player/mp_core.h" #include "mpvcore/mp_msg.h" #include "demux/demux.h" #include "mpvcore/path.h"