2014-03-11 23:40:55 +00:00
|
|
|
import re
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
def _add_rst_manual_dependencies(ctx):
|
|
|
|
manpage_sources_basenames = """
|
|
|
|
options.rst ao.rst vo.rst af.rst vf.rst encode.rst
|
|
|
|
input.rst osc.rst lua.rst changes.rst""".split()
|
|
|
|
|
2014-06-20 21:01:12 +00:00
|
|
|
manpage_sources = ['DOCS/man/'+x for x in manpage_sources_basenames]
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
for manpage_source in manpage_sources:
|
|
|
|
ctx.add_manual_dependency(
|
2014-06-20 21:01:12 +00:00
|
|
|
ctx.path.find_node('DOCS/man/mpv.rst'),
|
2013-07-16 11:28:28 +00:00
|
|
|
ctx.path.find_node(manpage_source))
|
|
|
|
|
|
|
|
def _build_man(ctx):
|
|
|
|
ctx(
|
|
|
|
name = 'rst2man',
|
2014-06-20 21:01:12 +00:00
|
|
|
target = 'DOCS/man/mpv.1',
|
|
|
|
source = 'DOCS/man/mpv.rst',
|
2013-07-16 11:28:28 +00:00
|
|
|
rule = '${RST2MAN} ${SRC} ${TGT}',
|
2013-11-23 10:35:16 +00:00
|
|
|
install_path = ctx.env.MANDIR + '/man1')
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
_add_rst_manual_dependencies(ctx)
|
|
|
|
|
|
|
|
def _build_pdf(ctx):
|
2014-01-08 15:43:33 +00:00
|
|
|
ctx(
|
|
|
|
name = 'rst2pdf',
|
2014-06-20 21:01:12 +00:00
|
|
|
target = 'DOCS/man/mpv.pdf',
|
|
|
|
source = 'DOCS/man/mpv.rst',
|
2014-01-08 15:43:33 +00:00
|
|
|
rule = '${RST2PDF} -c --repeat-table-rows ${SRC} -o ${TGT}',
|
|
|
|
install_path = ctx.env.DOCDIR)
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
_add_rst_manual_dependencies(ctx)
|
|
|
|
|
|
|
|
def build(ctx):
|
|
|
|
ctx.load('waf_customizations')
|
|
|
|
ctx.load('generators.sources')
|
|
|
|
|
2014-01-14 07:18:05 +00:00
|
|
|
ctx.file2string(
|
|
|
|
source = "TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns",
|
|
|
|
target = "osdep/macosx_icon.inc")
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
ctx.file2string(
|
|
|
|
source = "video/out/x11_icon.bin",
|
|
|
|
target = "video/out/x11_icon.inc")
|
|
|
|
|
|
|
|
ctx.file2string(
|
|
|
|
source = "etc/input.conf",
|
2013-12-17 00:23:09 +00:00
|
|
|
target = "input/input_conf.h")
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
ctx.file2string(
|
|
|
|
source = "video/out/gl_video_shaders.glsl",
|
|
|
|
target = "video/out/gl_video_shaders.h")
|
|
|
|
|
|
|
|
ctx.file2string(
|
|
|
|
source = "sub/osd_font.otf",
|
|
|
|
target = "sub/osd_font.h")
|
|
|
|
|
|
|
|
ctx.file2string(
|
2013-12-16 23:53:22 +00:00
|
|
|
source = "player/lua/defaults.lua",
|
|
|
|
target = "player/lua/defaults.inc")
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
ctx.file2string(
|
2013-12-16 23:53:22 +00:00
|
|
|
source = "player/lua/assdraw.lua",
|
|
|
|
target = "player/lua/assdraw.inc")
|
2013-07-16 11:28:28 +00:00
|
|
|
|
2014-05-23 11:24:27 +00:00
|
|
|
ctx.file2string(
|
|
|
|
source = "player/lua/options.lua",
|
|
|
|
target = "player/lua/options.inc")
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
ctx.file2string(
|
2013-12-16 23:53:22 +00:00
|
|
|
source = "player/lua/osc.lua",
|
|
|
|
target = "player/lua/osc.inc")
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
ctx.matroska_header(
|
|
|
|
source = "demux/ebml.c demux/demux_mkv.c",
|
|
|
|
target = "ebml_types.h")
|
|
|
|
|
|
|
|
ctx.matroska_definitions(
|
|
|
|
source = "demux/ebml.c",
|
|
|
|
target = "ebml_defs.c")
|
|
|
|
|
|
|
|
getch2_c = {
|
2013-12-19 20:31:27 +00:00
|
|
|
'win32': 'osdep/terminal-win.c',
|
|
|
|
}.get(ctx.env.DEST_OS, "osdep/terminal-unix.c")
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
timer_c = {
|
|
|
|
'win32': 'osdep/timer-win2.c',
|
|
|
|
'darwin': 'osdep/timer-darwin.c',
|
|
|
|
}.get(ctx.env.DEST_OS, "osdep/timer-linux.c")
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
## Audio
|
|
|
|
( "audio/audio.c" ),
|
|
|
|
( "audio/audio_buffer.c" ),
|
|
|
|
( "audio/chmap.c" ),
|
|
|
|
( "audio/chmap_sel.c" ),
|
|
|
|
( "audio/fmt-conversion.c" ),
|
|
|
|
( "audio/format.c" ),
|
|
|
|
( "audio/mixer.c" ),
|
|
|
|
( "audio/decode/ad_lavc.c" ),
|
|
|
|
( "audio/decode/ad_mpg123.c", "mpg123" ),
|
|
|
|
( "audio/decode/ad_spdif.c" ),
|
|
|
|
( "audio/decode/dec_audio.c" ),
|
|
|
|
( "audio/filter/af.c" ),
|
|
|
|
( "audio/filter/af_bs2b.c", "libbs2b" ),
|
|
|
|
( "audio/filter/af_center.c" ),
|
|
|
|
( "audio/filter/af_channels.c" ),
|
|
|
|
( "audio/filter/af_convert24.c" ),
|
|
|
|
( "audio/filter/af_convertsignendian.c" ),
|
|
|
|
( "audio/filter/af_delay.c" ),
|
|
|
|
( "audio/filter/af_drc.c" ),
|
|
|
|
( "audio/filter/af_dummy.c" ),
|
|
|
|
( "audio/filter/af_equalizer.c" ),
|
|
|
|
( "audio/filter/af_export.c", "sys-mman-h" ),
|
|
|
|
( "audio/filter/af_extrastereo.c" ),
|
|
|
|
( "audio/filter/af_format.c" ),
|
|
|
|
( "audio/filter/af_hrtf.c" ),
|
|
|
|
( "audio/filter/af_karaoke.c" ),
|
|
|
|
( "audio/filter/af_ladspa.c", "ladspa" ),
|
|
|
|
( "audio/filter/af_lavcac3enc.c" ),
|
2014-03-16 09:25:05 +00:00
|
|
|
( "audio/filter/af_lavfi.c", "libavfilter" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "audio/filter/af_lavrresample.c" ),
|
|
|
|
( "audio/filter/af_pan.c" ),
|
|
|
|
( "audio/filter/af_scaletempo.c" ),
|
|
|
|
( "audio/filter/af_sinesuppress.c" ),
|
|
|
|
( "audio/filter/af_sub.c" ),
|
|
|
|
( "audio/filter/af_surround.c" ),
|
|
|
|
( "audio/filter/af_sweep.c" ),
|
|
|
|
( "audio/filter/af_volume.c" ),
|
|
|
|
( "audio/filter/filter.c" ),
|
|
|
|
( "audio/filter/tools.c" ),
|
|
|
|
( "audio/filter/window.c" ),
|
|
|
|
( "audio/out/ao.c" ),
|
|
|
|
( "audio/out/ao_alsa.c", "alsa" ),
|
|
|
|
( "audio/out/ao_coreaudio.c", "coreaudio" ),
|
2014-06-30 17:09:03 +00:00
|
|
|
( "audio/out/ao_coreaudio_device.c", "coreaudio" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "audio/out/ao_coreaudio_properties.c", "coreaudio" ),
|
|
|
|
( "audio/out/ao_coreaudio_utils.c", "coreaudio" ),
|
|
|
|
( "audio/out/ao_dsound.c", "dsound" ),
|
|
|
|
( "audio/out/ao_jack.c", "jack" ),
|
|
|
|
( "audio/out/ao_lavc.c", "encoding" ),
|
|
|
|
( "audio/out/ao_null.c" ),
|
|
|
|
( "audio/out/ao_openal.c", "openal" ),
|
|
|
|
( "audio/out/ao_oss.c", "oss-audio" ),
|
|
|
|
( "audio/out/ao_pcm.c" ),
|
|
|
|
( "audio/out/ao_portaudio.c", "portaudio" ),
|
|
|
|
( "audio/out/ao_pulse.c", "pulse" ),
|
|
|
|
( "audio/out/ao_rsound.c", "rsound" ),
|
2014-01-24 23:30:28 +00:00
|
|
|
( "audio/out/ao_sdl.c", "sdl1" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "audio/out/ao_sdl.c", "sdl2" ),
|
|
|
|
( "audio/out/ao_sndio.c", "sndio" ),
|
|
|
|
( "audio/out/ao_wasapi.c", "wasapi" ),
|
2014-03-09 23:13:36 +00:00
|
|
|
( "audio/out/ao_wasapi_utils.c", "wasapi" ),
|
2014-03-08 23:04:37 +00:00
|
|
|
( "audio/out/pull.c" ),
|
|
|
|
( "audio/out/push.c" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
|
2013-12-17 01:39:45 +00:00
|
|
|
## Bstr
|
|
|
|
( "bstr/bstr.c" ),
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
## Core
|
2013-12-17 01:39:45 +00:00
|
|
|
( "common/av_common.c" ),
|
|
|
|
( "common/av_log.c" ),
|
|
|
|
( "common/codecs.c" ),
|
|
|
|
( "common/encode_lavc.c", "encoding" ),
|
|
|
|
( "common/common.c" ),
|
2014-04-13 12:01:55 +00:00
|
|
|
( "common/tags.c" ),
|
2013-12-17 01:39:45 +00:00
|
|
|
( "common/msg.c" ),
|
|
|
|
( "common/playlist.c" ),
|
|
|
|
( "common/version.c" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
## Demuxers
|
|
|
|
( "demux/codec_tags.c" ),
|
|
|
|
( "demux/demux.c" ),
|
|
|
|
( "demux/demux_cue.c" ),
|
2014-07-14 23:49:02 +00:00
|
|
|
( "demux/demux_disc.c" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "demux/demux_edl.c" ),
|
|
|
|
( "demux/demux_lavf.c" ),
|
|
|
|
( "demux/demux_libass.c", "libass"),
|
|
|
|
( "demux/demux_mf.c" ),
|
|
|
|
( "demux/demux_mkv.c" ),
|
|
|
|
( "demux/demux_playlist.c" ),
|
|
|
|
( "demux/demux_raw.c" ),
|
|
|
|
( "demux/demux_subreader.c" ),
|
2014-07-05 15:00:23 +00:00
|
|
|
( "demux/demux_tv.c", "tv" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "demux/ebml.c" ),
|
|
|
|
( "demux/mf.c" ),
|
2014-07-05 14:45:28 +00:00
|
|
|
( "demux/packet.c" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
|
2013-12-17 00:23:09 +00:00
|
|
|
## Input
|
2013-12-26 16:10:35 +00:00
|
|
|
( "input/cmd_list.c" ),
|
|
|
|
( "input/cmd_parse.c" ),
|
2014-01-04 15:59:22 +00:00
|
|
|
( "input/event.c" ),
|
2013-12-17 00:23:09 +00:00
|
|
|
( "input/input.c" ),
|
2013-12-26 16:10:35 +00:00
|
|
|
( "input/keycodes.c" ),
|
input: redo how --input-file is handled
Abandon the "old" infrastructure for --input-file (mp_input_add_fd(),
select() loop, non-blocking reads). Replace it with something that
starts a reader thread, using blocking input.
This is for the sake of Windows. Windows is a truly insane operating
system, and there's not even a way to read a pipe in a non-blocking
way, or to wait for new input in an interruptible way (like with
poll()). And unfortunately, some want to use pipe to send input to
mpv. There are probably (slightly) better IPC mechanisms available
on Windows, but for the sake of platform uniformity, make this work
again for now.
On Vista+, CancelIoEx() could probably be used. But there's no way on
XP. Also, that function doesn't work on wine, making development
harder. We could forcibly terminate the thread, which might work, but
is unsafe. So what we do is starting a thread, and if we don't want
the pipe input anymore, we just abandon the thread. The thread might
remain blocked forever, but if we exit the process, the kernel will
forcibly kill it. On Unix, just use poll() to handle this.
Unfortunately the code is pretty crappy, but it's ok, because it's late
and I wanted to stop working on this an hour ago.
Tested on wine; might not work on a real Windows.
2014-08-24 21:50:43 +00:00
|
|
|
( "input/pipe.c" ),
|
2013-12-17 00:23:09 +00:00
|
|
|
( "input/joystick.c", "joystick" ),
|
|
|
|
( "input/lirc.c", "lirc" ),
|
|
|
|
|
2013-12-17 01:39:45 +00:00
|
|
|
## Misc
|
|
|
|
( "misc/charset_conv.c" ),
|
2014-04-23 18:37:57 +00:00
|
|
|
( "misc/dispatch.c" ),
|
|
|
|
( "misc/ring.c" ),
|
Add Plan 9-style barriers
Plan 9 has a very interesting synchronization mechanism, the
rendezvous() call. A good property of this is that you don't need to
explicitly initialize and destroy a barrier object, unlike as with e.g.
POSIX barriers (which are mandatory to begin with). Upon "meeting", they
can exchange a value.
This mechanism will be nice to synchronize certain stages of
initialization between threads in the following commit.
Unlike Plan 9 rendezvous(), this is not implemented with a hashtable,
because that would require additional effort (especially if you want to
make it actually scele). Unlike the Plan 9 variant, we use intptr_t
instead of void* as type for the value, because I expect that we will be
mostly passing a status code as value and not a pointer. Converting an
integer to void* requires two cast (because the integer needs to be
intptr_t), the other way around it's only one cast.
We don't particularly care about performance in this case either. It's
simply not important for our use-case. So a simple linked list is used
for waiters, and on wakeup, all waiters are temporarily woken up.
2014-07-26 18:29:48 +00:00
|
|
|
( "misc/rendezvous.c" ),
|
2013-12-17 01:39:45 +00:00
|
|
|
|
2013-12-17 01:02:25 +00:00
|
|
|
## Options
|
|
|
|
( "options/m_config.c" ),
|
|
|
|
( "options/m_option.c" ),
|
|
|
|
( "options/m_property.c" ),
|
|
|
|
( "options/options.c" ),
|
|
|
|
( "options/parse_commandline.c" ),
|
|
|
|
( "options/parse_configfile.c" ),
|
|
|
|
( "options/path.c" ),
|
|
|
|
|
2013-12-16 23:53:22 +00:00
|
|
|
## Player
|
|
|
|
( "player/audio.c" ),
|
2014-02-10 20:01:35 +00:00
|
|
|
( "player/client.c" ),
|
2013-12-16 23:53:22 +00:00
|
|
|
( "player/command.c" ),
|
|
|
|
( "player/configfiles.c" ),
|
2014-07-14 23:49:02 +00:00
|
|
|
( "player/discnav.c" ),
|
2013-12-16 23:53:22 +00:00
|
|
|
( "player/loadfile.c" ),
|
|
|
|
( "player/main.c" ),
|
|
|
|
( "player/misc.c" ),
|
2013-12-17 00:15:48 +00:00
|
|
|
( "player/lua.c", "lua" ),
|
2013-12-16 23:53:22 +00:00
|
|
|
( "player/osd.c" ),
|
|
|
|
( "player/playloop.c" ),
|
|
|
|
( "player/screenshot.c" ),
|
2014-05-12 23:14:07 +00:00
|
|
|
( "player/scripting.c" ),
|
2013-12-16 23:53:22 +00:00
|
|
|
( "player/sub.c" ),
|
|
|
|
( "player/timeline/tl_cue.c" ),
|
|
|
|
( "player/timeline/tl_mpv_edl.c" ),
|
|
|
|
( "player/timeline/tl_matroska.c" ),
|
|
|
|
( "player/video.c" ),
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
## Streams
|
|
|
|
( "stream/ai_alsa1x.c", "alsa" ),
|
|
|
|
( "stream/ai_oss.c", "oss-audio" ),
|
|
|
|
( "stream/ai_sndio.c", "sndio" ),
|
|
|
|
( "stream/audio_in.c", "audio-input" ),
|
2013-11-28 18:28:38 +00:00
|
|
|
( "stream/cache.c" ),
|
2014-06-22 00:50:52 +00:00
|
|
|
( "stream/cache_file.c" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "stream/cookies.c" ),
|
|
|
|
( "stream/dvb_tune.c", "dvbin" ),
|
|
|
|
( "stream/frequencies.c", "tv" ),
|
|
|
|
( "stream/rar.c" ),
|
|
|
|
( "stream/stream.c" ),
|
|
|
|
( "stream/stream_avdevice.c" ),
|
2014-07-14 23:49:02 +00:00
|
|
|
( "stream/stream_bluray.c", "libbluray" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "stream/stream_cdda.c", "cdda" ),
|
|
|
|
( "stream/stream_dvb.c", "dvbin" ),
|
2014-07-14 23:49:02 +00:00
|
|
|
( "stream/stream_dvd.c", "dvdread" ),
|
|
|
|
( "stream/stream_dvd_common.c", "dvdread" ),
|
|
|
|
( "stream/stream_dvdnav.c", "dvdnav" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "stream/stream_edl.c" ),
|
|
|
|
( "stream/stream_file.c" ),
|
|
|
|
( "stream/stream_lavf.c" ),
|
|
|
|
( "stream/stream_memory.c" ),
|
|
|
|
( "stream/stream_mf.c" ),
|
|
|
|
( "stream/stream_null.c" ),
|
|
|
|
( "stream/stream_pvr.c", "pvr" ),
|
|
|
|
( "stream/stream_rar.c" ),
|
|
|
|
( "stream/stream_smb.c", "libsmbclient" ),
|
|
|
|
( "stream/stream_tv.c", "tv" ),
|
|
|
|
( "stream/tv.c", "tv" ),
|
|
|
|
( "stream/tvi_dummy.c", "tv" ),
|
|
|
|
( "stream/tvi_v4l2.c", "tv-v4l2"),
|
2013-12-17 00:40:26 +00:00
|
|
|
( "stream/resolve/resolve_quvi.c", "libquvi4" ),
|
|
|
|
( "stream/resolve/resolve_quvi9.c", "libquvi9" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
## Subtitles
|
|
|
|
( "sub/ass_mp.c", "libass"),
|
|
|
|
( "sub/dec_sub.c" ),
|
|
|
|
( "sub/draw_bmp.c" ),
|
|
|
|
( "sub/find_subfiles.c" ),
|
|
|
|
( "sub/img_convert.c" ),
|
2013-11-24 11:58:06 +00:00
|
|
|
( "sub/osd.c" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "sub/osd_dummy.c", "dummy-osd" ),
|
|
|
|
( "sub/osd_libass.c", "libass-osd" ),
|
|
|
|
( "sub/sd_ass.c", "libass" ),
|
|
|
|
( "sub/sd_lavc.c" ),
|
|
|
|
( "sub/sd_lavc_conv.c" ),
|
|
|
|
( "sub/sd_lavf_srt.c" ),
|
|
|
|
( "sub/sd_microdvd.c" ),
|
|
|
|
( "sub/sd_movtext.c" ),
|
|
|
|
( "sub/sd_srt.c" ),
|
|
|
|
|
|
|
|
## Video
|
|
|
|
( "video/csputils.c" ),
|
|
|
|
( "video/fmt-conversion.c" ),
|
|
|
|
( "video/image_writer.c" ),
|
|
|
|
( "video/img_format.c" ),
|
|
|
|
( "video/mp_image.c" ),
|
|
|
|
( "video/mp_image_pool.c" ),
|
|
|
|
( "video/sws_utils.c" ),
|
|
|
|
( "video/vaapi.c", "vaapi" ),
|
|
|
|
( "video/vdpau.c", "vdpau" ),
|
2014-04-29 13:07:21 +00:00
|
|
|
( "video/vdpau_mixer.c", "vdpau" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/decode/dec_video.c"),
|
|
|
|
( "video/decode/vaapi.c", "vaapi-hwaccel" ),
|
|
|
|
( "video/decode/vd_lavc.c" ),
|
|
|
|
( "video/decode/vda.c", "vda-hwaccel" ),
|
|
|
|
( "video/decode/vdpau.c", "vdpau-hwaccel" ),
|
|
|
|
( "video/filter/pullup.c" ),
|
|
|
|
( "video/filter/vf.c" ),
|
2014-07-30 20:44:35 +00:00
|
|
|
( "video/filter/vf_buffer.c" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/filter/vf_crop.c" ),
|
|
|
|
( "video/filter/vf_delogo.c" ),
|
|
|
|
( "video/filter/vf_divtc.c" ),
|
|
|
|
( "video/filter/vf_dlopen.c", "dlopen" ),
|
|
|
|
( "video/filter/vf_dsize.c" ),
|
|
|
|
( "video/filter/vf_eq.c" ),
|
|
|
|
( "video/filter/vf_expand.c" ),
|
|
|
|
( "video/filter/vf_flip.c" ),
|
|
|
|
( "video/filter/vf_format.c" ),
|
|
|
|
( "video/filter/vf_gradfun.c" ),
|
|
|
|
( "video/filter/vf_hqdn3d.c" ),
|
|
|
|
( "video/filter/vf_ilpack.c" ),
|
2014-03-16 09:25:05 +00:00
|
|
|
( "video/filter/vf_lavfi.c", "libavfilter"),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/filter/vf_mirror.c" ),
|
|
|
|
( "video/filter/vf_noformat.c" ),
|
|
|
|
( "video/filter/vf_noise.c" ),
|
|
|
|
( "video/filter/vf_phase.c" ),
|
|
|
|
( "video/filter/vf_pp.c", "libpostproc" ),
|
|
|
|
( "video/filter/vf_pullup.c" ),
|
|
|
|
( "video/filter/vf_rotate.c" ),
|
|
|
|
( "video/filter/vf_scale.c" ),
|
|
|
|
( "video/filter/vf_screenshot.c" ),
|
|
|
|
( "video/filter/vf_softpulldown.c" ),
|
|
|
|
( "video/filter/vf_stereo3d.c" ),
|
|
|
|
( "video/filter/vf_sub.c" ),
|
|
|
|
( "video/filter/vf_swapuv.c" ),
|
|
|
|
( "video/filter/vf_unsharp.c" ),
|
2014-04-12 15:51:19 +00:00
|
|
|
( "video/filter/vf_vapoursynth.c", "vapoursynth" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/filter/vf_vavpp.c", "vaapi-vpp"),
|
2014-04-29 13:07:21 +00:00
|
|
|
( "video/filter/vf_vdpaupp.c", "vdpau" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/filter/vf_yadif.c" ),
|
|
|
|
( "video/out/aspect.c" ),
|
|
|
|
( "video/out/bitmap_packer.c" ),
|
|
|
|
( "video/out/cocoa/additions.m", "cocoa" ),
|
|
|
|
( "video/out/cocoa/view.m", "cocoa" ),
|
|
|
|
( "video/out/cocoa/window.m", "cocoa" ),
|
|
|
|
( "video/out/cocoa_common.m", "cocoa" ),
|
|
|
|
( "video/out/dither.c" ),
|
|
|
|
( "video/out/filter_kernels.c" ),
|
|
|
|
( "video/out/gl_cocoa.c", "gl-cocoa" ),
|
|
|
|
( "video/out/gl_common.c", "gl" ),
|
|
|
|
( "video/out/gl_hwdec_vaglx.c", "vaapi-glx" ),
|
2013-11-13 20:59:11 +00:00
|
|
|
( "video/out/gl_hwdec_vda.c", "vda-gl" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/out/gl_hwdec_vdpau.c", "vdpau-gl-x11" ),
|
|
|
|
( "video/out/gl_lcms.c", "gl" ),
|
|
|
|
( "video/out/gl_osd.c", "gl" ),
|
|
|
|
( "video/out/gl_video.c", "gl" ),
|
|
|
|
( "video/out/gl_w32.c", "gl-win32" ),
|
|
|
|
( "video/out/gl_wayland.c", "gl-wayland" ),
|
|
|
|
( "video/out/gl_x11.c", "gl-x11" ),
|
|
|
|
( "video/out/pnm_loader.c", "gl" ),
|
|
|
|
( "video/out/vo.c" ),
|
|
|
|
( "video/out/vo_caca.c", "caca" ),
|
|
|
|
( "video/out/vo_corevideo.c", "corevideo"),
|
|
|
|
( "video/out/vo_direct3d.c", "direct3d" ),
|
|
|
|
( "video/out/vo_image.c" ),
|
|
|
|
( "video/out/vo_lavc.c", "encoding" ),
|
|
|
|
( "video/out/vo_null.c" ),
|
|
|
|
( "video/out/vo_opengl.c", "gl" ),
|
|
|
|
( "video/out/vo_opengl_old.c", "gl" ),
|
|
|
|
( "video/out/vo_sdl.c", "sdl2" ),
|
|
|
|
( "video/out/vo_vaapi.c", "vaapi" ),
|
|
|
|
( "video/out/vo_vdpau.c", "vdpau" ),
|
|
|
|
( "video/out/vo_wayland.c", "wayland" ),
|
|
|
|
( "video/out/vo_x11.c" , "x11" ),
|
|
|
|
( "video/out/vo_xv.c", "xv" ),
|
2013-11-22 19:58:48 +00:00
|
|
|
( "video/out/w32_common.c", "gdi" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/out/wayland_common.c", "wayland" ),
|
2014-05-06 18:22:32 +00:00
|
|
|
( "video/out/win_state.c"),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "video/out/x11_common.c", "x11" ),
|
|
|
|
|
|
|
|
## osdep
|
|
|
|
( getch2_c ),
|
|
|
|
( "osdep/io.c" ),
|
|
|
|
( "osdep/numcores.c"),
|
|
|
|
( "osdep/timer.c" ),
|
|
|
|
( timer_c ),
|
|
|
|
( "osdep/threads.c" ),
|
|
|
|
|
|
|
|
( "osdep/ar/HIDRemote.m", "cocoa" ),
|
2014-04-16 02:52:24 +00:00
|
|
|
( "osdep/macosx_application.m", "cocoa-application" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "osdep/macosx_events.m", "cocoa" ),
|
|
|
|
( "osdep/path-macosx.m", "cocoa" ),
|
|
|
|
|
|
|
|
( "osdep/path-win.c", "os-win32" ),
|
|
|
|
( "osdep/path-win.c", "os-cygwin" ),
|
|
|
|
( "osdep/glob-win.c", "glob-win32-replacement" ),
|
2014-01-19 13:20:02 +00:00
|
|
|
( "osdep/w32_keyboard.c", "os-win32" ),
|
|
|
|
( "osdep/w32_keyboard.c", "os-cygwin" ),
|
2013-07-16 11:28:28 +00:00
|
|
|
( "osdep/mpv.rc", "win32-executable" ),
|
|
|
|
|
|
|
|
## tree_allocator
|
|
|
|
"ta/ta.c", "ta/ta_talloc.c", "ta/ta_utils.c"
|
|
|
|
]
|
|
|
|
|
|
|
|
if ctx.dependency_satisfied('win32-executable'):
|
|
|
|
from waflib import TaskGen
|
|
|
|
|
|
|
|
TaskGen.declare_chain(
|
|
|
|
name = 'windres',
|
|
|
|
rule = '${WINDRES} ${WINDRES_FLAGS} ${SRC} ${TGT}',
|
|
|
|
ext_in = '.rc',
|
|
|
|
ext_out = '-rc.o',
|
|
|
|
color = 'PINK')
|
|
|
|
|
|
|
|
ctx.env.WINDRES_FLAGS = [
|
|
|
|
'--include-dir={0}'.format(ctx.bldnode.abspath()),
|
|
|
|
'--include-dir={0}'.format(ctx.srcnode.abspath())
|
|
|
|
]
|
|
|
|
|
|
|
|
for node in 'osdep/mpv.exe.manifest etc/mpv-icon.ico'.split():
|
|
|
|
ctx.add_manual_dependency(
|
|
|
|
ctx.path.find_node('osdep/mpv.rc'),
|
|
|
|
ctx.path.find_node(node))
|
|
|
|
|
|
|
|
cprog_kwargs = {}
|
|
|
|
if ctx.dependency_satisfied('macosx-bundle'):
|
|
|
|
import os
|
|
|
|
basepath = 'TOOLS/osxbundle/mpv.app/Contents'
|
|
|
|
cprog_kwargs['mac_app'] = True
|
|
|
|
cprog_kwargs['mac_plist'] = os.path.join(basepath, 'Info.plist')
|
|
|
|
|
|
|
|
resources_glob = os.path.join(basepath, 'Resources', '*')
|
|
|
|
resources_nodes = ctx.srcnode.ant_glob(resources_glob)
|
|
|
|
resources = [node.srcpath() for node in resources_nodes]
|
|
|
|
cprog_kwargs['mac_resources'] = resources
|
|
|
|
|
2013-11-25 07:19:18 +00:00
|
|
|
for resource in resources:
|
|
|
|
res_basename = os.path.basename(resource)
|
|
|
|
install_name = '/mpv.app/Contents/Resources/' + res_basename
|
|
|
|
ctx.install_as(ctx.env.BINDIR + install_name, resource)
|
|
|
|
|
2014-08-04 08:54:22 +00:00
|
|
|
|
|
|
|
if ctx.dependency_satisfied('cplayer'):
|
|
|
|
ctx(
|
|
|
|
target = "mpv",
|
|
|
|
source = ctx.filtered_sources(sources) + ["player/main_fn.c"],
|
|
|
|
use = ctx.dependencies_use(),
|
|
|
|
includes = [ctx.bldnode.abspath(), ctx.srcnode.abspath()] + \
|
|
|
|
ctx.dependencies_includes(),
|
|
|
|
features = "c cprogram",
|
|
|
|
install_path = ctx.env.BINDIR,
|
|
|
|
**cprog_kwargs
|
|
|
|
)
|
2013-07-16 11:28:28 +00:00
|
|
|
|
2014-06-16 09:22:46 +00:00
|
|
|
build_shared = ctx.dependency_satisfied('libmpv-shared')
|
|
|
|
build_static = ctx.dependency_satisfied('libmpv-static')
|
|
|
|
if build_shared or build_static:
|
|
|
|
if build_shared:
|
2014-08-12 17:19:20 +00:00
|
|
|
import os
|
|
|
|
waftoolsdir = os.path.join(os.path.dirname(__file__), "waftools")
|
|
|
|
ctx.load("syms", tooldir=waftoolsdir)
|
2014-08-05 00:23:14 +00:00
|
|
|
vre = '^#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION\((.*), (.*)\)$'
|
|
|
|
libmpv_header = ctx.path.find_node("libmpv/client.h").read()
|
|
|
|
major, minor = re.search(vre, libmpv_header, re.M).groups()
|
|
|
|
libversion = major + '.' + minor + '.0'
|
2014-06-20 17:21:11 +00:00
|
|
|
|
2014-06-16 09:22:46 +00:00
|
|
|
def _build_libmpv(shared):
|
|
|
|
features = "c "
|
|
|
|
if shared:
|
|
|
|
features += "cshlib syms"
|
|
|
|
else:
|
|
|
|
features += "cstlib"
|
|
|
|
ctx(
|
|
|
|
target = "mpv",
|
|
|
|
source = ctx.filtered_sources(sources),
|
|
|
|
use = ctx.dependencies_use(),
|
|
|
|
includes = [ctx.bldnode.abspath(), ctx.srcnode.abspath()] + \
|
|
|
|
ctx.dependencies_includes(),
|
|
|
|
features = features,
|
2014-08-05 17:58:36 +00:00
|
|
|
export_symbols_def = "libmpv/mpv.def",
|
2014-06-16 09:22:46 +00:00
|
|
|
install_path = ctx.env.LIBDIR,
|
|
|
|
vnum = libversion,
|
|
|
|
)
|
|
|
|
if build_shared:
|
|
|
|
_build_libmpv(True)
|
|
|
|
if build_static:
|
|
|
|
_build_libmpv(False)
|
2014-02-10 20:25:22 +00:00
|
|
|
|
2014-08-07 21:45:40 +00:00
|
|
|
def get_deps():
|
|
|
|
res = ""
|
|
|
|
for k in ctx.env.keys():
|
|
|
|
if k.startswith("LIB_") and k != "LIB_ST":
|
|
|
|
res += " ".join(["-l" + x for x in ctx.env[k]]) + " "
|
|
|
|
return res
|
|
|
|
|
2014-03-11 15:55:49 +00:00
|
|
|
ctx(
|
|
|
|
target = 'libmpv/mpv.pc',
|
|
|
|
source = 'libmpv/mpv.pc.in',
|
|
|
|
features = 'subst',
|
|
|
|
PREFIX = ctx.env.PREFIX,
|
|
|
|
LIBDIR = ctx.env.LIBDIR,
|
|
|
|
INCDIR = ctx.env.INCDIR,
|
2014-03-11 23:40:55 +00:00
|
|
|
VERSION = libversion,
|
2014-08-07 21:45:40 +00:00
|
|
|
PRIV_LIBS = get_deps(),
|
2014-03-11 15:55:49 +00:00
|
|
|
)
|
|
|
|
|
2014-02-10 20:25:22 +00:00
|
|
|
headers = ["client.h"]
|
|
|
|
for f in headers:
|
2014-03-11 16:06:06 +00:00
|
|
|
ctx.install_as(ctx.env.INCDIR + '/mpv/' + f, 'libmpv/' + f)
|
2014-02-10 20:25:22 +00:00
|
|
|
|
2014-03-11 15:55:49 +00:00
|
|
|
ctx.install_as(ctx.env.LIBDIR + '/pkgconfig/mpv.pc', 'libmpv/mpv.pc')
|
|
|
|
|
2014-02-10 20:30:55 +00:00
|
|
|
if ctx.dependency_satisfied('client-api-examples'):
|
|
|
|
# This assumes all examples are single-file (as examples should be)
|
|
|
|
for f in ["simple"]:
|
|
|
|
ctx(
|
|
|
|
target = f,
|
|
|
|
source = "DOCS/client_api_examples/" + f + ".c",
|
|
|
|
includes = [ctx.bldnode.abspath(), ctx.srcnode.abspath()],
|
|
|
|
use = "mpv",
|
|
|
|
features = "c cprogram",
|
2014-06-06 17:43:53 +00:00
|
|
|
install_path = None
|
2014-02-10 20:30:55 +00:00
|
|
|
)
|
|
|
|
|
2014-01-02 04:26:22 +00:00
|
|
|
if ctx.env.DEST_OS == 'win32':
|
|
|
|
wrapctx = ctx(
|
|
|
|
target = "mpv",
|
|
|
|
source = ['osdep/win32-console-wrapper.c'],
|
|
|
|
features = "c cprogram",
|
|
|
|
install_path = ctx.env.BINDIR
|
|
|
|
)
|
|
|
|
|
|
|
|
wrapctx.env.cprogram_PATTERN = "%s.com"
|
|
|
|
wrapflags = ['-municode', '-mconsole']
|
|
|
|
wrapctx.env.CFLAGS = wrapflags
|
|
|
|
wrapctx.env.LAST_LINKFLAGS = wrapflags
|
|
|
|
|
2013-11-24 21:21:17 +00:00
|
|
|
if ctx.dependency_satisfied('macosx-bundle'):
|
2013-12-04 20:36:02 +00:00
|
|
|
from waflib import Utils
|
|
|
|
ctx.install_files(ctx.env.BINDIR, 'mpv', chmod=Utils.O755)
|
2013-11-24 21:21:17 +00:00
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
if ctx.dependency_satisfied("vf-dlopen-filters"):
|
|
|
|
dlfilters = "showqscale telecine tile rectangle framestep \
|
|
|
|
ildetect".split()
|
|
|
|
for dlfilter in dlfilters:
|
|
|
|
ctx(
|
|
|
|
target = dlfilter,
|
|
|
|
source = ['TOOLS/vf_dlopen/'+dlfilter+'.c',
|
|
|
|
'TOOLS/vf_dlopen/filterutils.c'],
|
|
|
|
includes = [ctx.srcnode.abspath() + '/video/filter'],
|
|
|
|
features = 'c cshlib',
|
|
|
|
install_path = ctx.env.LIBDIR + '/mpv' )
|
|
|
|
|
|
|
|
if ctx.dependency_satisfied('manpage-build'):
|
|
|
|
_build_man(ctx)
|
|
|
|
|
|
|
|
if ctx.dependency_satisfied('pdf-build'):
|
|
|
|
_build_pdf(ctx)
|
|
|
|
|
2014-06-08 14:00:43 +00:00
|
|
|
if ctx.dependency_satisfied('zsh-comp'):
|
|
|
|
ctx.zshcomp(target = "etc/_mpv")
|
|
|
|
ctx.install_files(
|
|
|
|
ctx.env.DATADIR + '/zsh/vendor-completions',
|
|
|
|
['etc/_mpv'])
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
ctx.install_files(
|
|
|
|
ctx.env.DATADIR + '/applications',
|
|
|
|
['etc/mpv.desktop'] )
|
|
|
|
|
2013-12-28 15:32:49 +00:00
|
|
|
ctx.install_files(ctx.env.CONFDIR, ['etc/encoding-profiles.conf'] )
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
for size in '16x16 32x32 64x64'.split():
|
|
|
|
ctx.install_as(
|
|
|
|
ctx.env.DATADIR + '/icons/hicolor/' + size + '/apps/mpv.png',
|
|
|
|
'etc/mpv-icon-8bit-' + size + '.png')
|